返回2^order个未清0连续物理页面,flags与kmalloc中flags一致,允许的最大order值为10或者11(根据体系结构不同)
*alloc_pages
Prototype:
struct page *alloc_pages_node(int nid, unsigned int flags,
unsigned int order);
Kernel中页分配器实现,__get_free_pages即调用alloc_pages实现的
The real core of the Linux page allocator is a function called alloc_pages_node:
*vmalloc
分配地址连续虚存,而不保证物理地址连续,大部分情况下适合“软件”,而不是驱动程序。相对而言,kmalloc和__get_free_pages虚存map到物理内存只需要增减一个偏移,而使用vmalloc分配需要修改页表,故vmalloc的开销较大,分配少数几个页面的效率太低。
*per-cpu variables
Each cpu hold an independant copy in their respective processor's caches, so there is no lock required and improve better performance, implemented as a linux 2.6 feature. Defined in <linux/percpu.h>.
DEFINE_PER_CPU(type, name);
get_cpu_var(sockets_in_use)++;
put_cpu_var(sockets_in_use);
