On Wed, Apr 24, 2024 at 02:52:41PM +0200, David Hildenbrand wrote: > Just as a side note, I would be interested into something that can easily > reclaim pages from slab in a specific physical memory area. Target use cases > are around alloc_contig_range(), memory offlining an similar. > > ... but IIUC, the barn/sheep approach wouldn't make that any easier, right? It'll make it harder, tbh, because today we track each object from its struct slab. If we want to do something like this, we need to do a few things: - Send an IPI to all CPUs to let them know they need to return their delayed-free sheaf immediately - CPUs on the node which owns the memory we're trying to reclaim also need to search their allocation sheaf for objects that we no longer want to allocate But I fear this is pointless. Unless we can get _all_ objects in the range back, we may as well get none of them. Which means we need a mechanism for asking the user of the kmem_cache to reallocate specific objects. We've looked at something like that before, most recently: https://lore.kernel.org/linux-mm/20190520054017.32299-11-tobin@xxxxxxxxxx/ (you can forget about ever reclaiming from kmalloc slabs, but a real slab cache could be movable)