Re: [patch] mm, slab: avoid high-order slab pages when it does not reduce waste

From: Christopher Lameter
Date: Mon Oct 15 2018 - 18:42:45 EST


On Fri, 12 Oct 2018, David Rientjes wrote:

> @@ -1803,6 +1804,20 @@ static size_t calculate_slab_order(struct kmem_cache *cachep,
> */
> if (left_over * 8 <= (PAGE_SIZE << gfporder))
> break;
> +
> + /*
> + * If a higher gfporder would not reduce internal fragmentation,
> + * no need to continue. The preference is to keep gfporder as
> + * small as possible so slab allocations can be served from
> + * MIGRATE_UNMOVABLE pcp lists to avoid stranding.
> + */

I think either go for order 0 (because then you can use the pcp lists) or
go as high as possible (then you can allocator larger memory areas with a
single pass through the page allocator).

But then I am not sure that the whole approach will do any good.