Re: [PATCH 0/3] mm: treewide: make get_free_pages() and return void *

From: Jiri Slaby

Date: Mon Oct 20 2025 - 05:08:32 EST


On 20. 10. 25, 11:02, David Hildenbrand wrote:
Regarding the metadata overhead, in 2015 Linus wrote in that thread:

"Long ago, allocating a page using kmalloc() was a bad idea, because
there was overhead for it in the allocation and the code.

These days, kmalloc() not only doesn't have the allocation overhead,
but may actually scale better too, thanks to percpu caches etc."

What's that status of that 10 years later?

AFAI skimmed through the code, for allocations > 2 pages (KMALLOC_MAX_CACHE_SIZE) -- if size is a constant -- slub resorts to alloc_pages().

For smaller ones (1 and 2 pages), there is a very little overhead in struct slab -- mm people, please correct me if I am wrong.

thanks,
--
js
suse labs