From: Christoph Lameter To: Pekka Enberg Cc: Mel Gorman Cc: Matt Mackall Cc: yanmin_zhang@linux.intel.com Cc: linux-mm@kvack.org Subject: slub: Fallback to order 0 and variable order slab support Subject-Prefix: [patch @num@/@total@] This patchset makes slub capable of handling arbitrary sizes of pages. Meaning that a slab cache that currently uses order 1 because of packing density issues can fallback to order 0 allocations if memory becomes fragmented. All allocations for objects <= PAGE_SIZE can fall back like that. So a single slab may contain various sizes of pages that may contain more or less objects. On the other hand it also enables slub to use larger page orders by default since it is now no problem to fall back to an order 0 alloc. The default max order is set to 3 which means that 32K compound pages can be used in some situations for large objects that do not fit into smaller pages. This in turn increases the number of times slub can use its fastpath before a fallback to the page allocator has to occur. The patchset realizes the initial intend of providing a feature comparable with the per cpu queue size in slab. The order for each slab cache can be configured from user space while the system is running. Increasing the default allocation order can be used to tune slub like slab. The allocated sizes can then also be effectively controlled via boot parameters (slub_min_order and slub_max_order). The patchset is also available via git git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm.git slab-mm V1->V2: - Fix debug issues - Improve performance by embedding nr of objects per slab in the page struct. This avoids a kmem_cache reference in slab_alloc thereby reducing the cache footprint. - Provide dynamic calculation of min_objects based on the nr of processors. - Fix statistics handling and update slabinfo tool.