用__get_free_pages分配大内存

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(gfp_mask, order)

Allocate 2order pages and return a pointer to the first page's logical address

get_zeroed_page(gfp_mask)

Allocate a single page, zero its contents, and return a pointer to its logical address

我代码里从来没用过分配大页连续物理内存,总是kmalloc,或dma_alloc_coherent,ARC正好dma函数没写好,回去还是改成__get_free_pages + invalidate dcache来做好了
另,以前总是记得slab用伙伴算法,最大分配128K,所以kmalloc最大分配128K连续内存,但这种记忆也会过时啊?稍不注意发现我们系统没用slab,而是slub,slub的代码我怎么一看最大8K啊,一定是我看错了。那我还敢不敢用kmalloc啊

你可能感兴趣的:(算法,table)