Re: [PATCH 0/5] make slab gfp fair

Christoph Lameter
2007-05-15T22:02:51Z

On Tue, 15 May 2007, Peter Zijlstra wrote:

> How about something like this; it seems to sustain a little stress.

Argh again mods to kmem_cache.

Could we do this with a new slab page flag? F.e. SlabEmergPool.

in alloc_slab() do

if (is_emergency_pool_page(page)) {
SetSlabDebug(page);
SetSlabEmerg(page);
}

So now you can intercept allocs to the SlabEmerg slab in __slab_alloc

debug:

if (SlabEmergPool(page)) {
if (mem_no_longer_critical()) {
/* Avoid future trapping */
ClearSlabDebug(page);
ClearSlabEmergPool(page);
} else
if (process_not_allowed_this_memory()) {
do_something_bad_to_the_caller();
} else {
/* Allocation permitted */
}
}

....