Skip to content

Commit 7ca67b1

Browse files
congwang-mkclaude
andcommitted
Fix alloc_pages() size claim in Lazy CMA blog post
The system heap actually uses order-8 (1MB) max allocations, not MAX_ORDER (4-8MB) as previously stated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3aafc8a commit 7ca67b1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

_posts/2026-03-08-introducing-lazy-cma.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ There are two ways to configure CMA. You can set `CONFIG_CMA_SIZE_MBYTES` at ker
1717

1818
This creates real operational friction. Cloud operators must predict memory needs ahead of time. Developers working with heterogeneous memory (CXL, PMEM) often cannot use CMA at all, because their memory is onlined post-boot and was never available during early reservation. And anyone using kdump must decide the crash kernel reservation size at boot, even though the optimal size depends on runtime conditions.
1919

20-
The DMA-BUF system heap (`/dev/dma_heap/system`) takes a different approach and avoids boot-time reservation entirely. However, it relies on `alloc_pages()`, which is constrained by the buddy allocator's maximum order (typically MAX_ORDER pages, around 4MB to 8MB per allocation). To fulfill a large request, the system heap must issue many separate `alloc_pages()` calls and assemble the results into a scatter-gather list. For allocations of hundreds of megabytes or more, this becomes slow and prone to failure under memory pressure. Use cases like kexec, multikernel, and DAXFS need a single contiguous physical range far exceeding what the buddy allocator can provide in one shot.
20+
The DMA-BUF system heap (`/dev/dma_heap/system`) takes a different approach and avoids boot-time reservation entirely. However, it relies on `alloc_pages()`, which is constrained to order-8 allocations (1MB per chunk) in practice. To fulfill a large request, the system heap must issue many separate `alloc_pages()` calls and assemble the results into a scatter-gather list. For allocations of hundreds of megabytes or more, this becomes slow and prone to failure under memory pressure. Use cases like kexec, multikernel, and DAXFS need a single contiguous physical range far exceeding what the buddy allocator can provide in one shot.
2121

2222
## How Lazy CMA Works
2323

0 commit comments

Comments
 (0)