Improvements for the contiguous memory allocator

As a system runs, its memory becomes fragmented; it does not take long before the allocation of large, physically contiguous memory ranges becomes difficult or impossible. The contiguous memory allocator (CMA) is a kernel subsystem that attempts to address this problem, but it has never worked as well as some would like. Two sessions in the memory-management track at the 2025 Linux Storage, Filesystem, Memory-Management, and BPF Summit looked at how CMA can be improved; the first looked at providing guaranteed allocations, while the second addressed some inefficiencies in CMA.
随着系统运行,其内存会变得碎片化;不需要太长时间,就会发现分配大块物理上连续的内存变得困难甚至不可能。连续内存分配器(CMA)是一个内核子系统,旨在解决这个问题,但其效果一直不如一些人所期望。在 2025 年的 Linux 存储、文件系统、内存管理和 BPF 峰会的内存管理主题中,有两个会议讨论了如何改进 CMA;第一个会议关注如何提供可保证的分配,第二个会议则讨论了 CMA 中的一些低效问题。

In current kernels, CMA works by reserving a large area of physically contiguous memory at boot time; it uses that area to satisfy requests for large allocations later on. In the absence of such allocations, the CMA reservation can be allocated for other purposes, but only movable allocations can be placed there. The intent is that, should a need for a large buffer arise, those other allocations can be migrated elsewhere in memory, freeing a physically contiguous range. The hoped-for result is that large allocations are always possible, but that the memory used for those allocations is not wasted when it is not needed.
在当前的内核中,CMA 的工作机制是在引导时预留一大片物理上连续的内存区域;该区域随后用于满足对大块内存的分配请求。如果没有此类分配请求,CMA 预留区可以用于其他目的,但只能放置可移动的内存分配。其设计目的是,在需要大缓冲区时,可以将这些可移动分配迁移到内存的其他位置,从而释放出一段物理连续的空间。理想的结果是始终能够成功进行大内存分配,而在不需要时这部分内存又不会被浪费。

Guaranteed CMA
可保证的 CMA

Suren Baghdasaryan ran a session to discuss the guaranteed contiguous memory allocator patches that he had posted shortly before the conference. This series, he said, was mostly based on older work from Minchan Kim and SeongJae Park, along with the "cleancache" abstraction first proposed by Dan Magenheimer in 2012.
Suren Baghdasaryan 主持了一个会议,讨论他在峰会前不久发布的一组“可保证的连续内存分配器”补丁。他表示,这一系列补丁主要基于 Minchan Kim 和 SeongJae Park 早期的工作,以及 Dan Magenheimer 在 2012 年首次提出的 "cleancache" 抽象机制。

The kernel has long provided two options for physically contiguous allocations, he said. The first is CMA, which has the advantage that the reserve

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mounter625

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值