Table 11.2. Low-Level Page Allocations Methods
Flag
Description
alloc_page(gfp_mask)
Allocate a single page and return a pointer to its page structure
alloc_pages(gfp_mask, order)
Allocate 2order pages and return a pointer to the first page's page structure
__get_free_page(gfp_mask)
Allocate a single page and return a pointer to its logical address

本文探讨了在代码中使用__get_free_pages代替kmalloc或dma_alloc_coherent来分配大页连续物理内存的原因,并提及slab与slub的区别,以及kmalloc可能的最大分配限制。对于没有slab而是slub的系统,作者提醒读者注意slub的最大分配大小,引发关于是否继续使用kmalloc的思考。
最低0.47元/天 解锁文章
958

被折叠的 条评论
为什么被折叠?



