Cc: Christoph Lameter <clameter@...>, James Bottomley <James.Bottomley@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, FUJITA Tomonori <fujita.tomonori@...>, Jens Axboe <jens.axboe@...>, Pekka Enberg <penberg@...>, Rafael J. Wysocki <rjw@...>, <linux-kernel@...>
On Mon, 2008-04-07 at 20:40 +0100, Hugh Dickins wrote:
Somewhere along the line of my swap over network patches I made
'robustified' SLAB to ensure these sorts of things could not happen - it
came at a cost though.
It would basically fail[*] allocations that had a higher low watermark
than what was used to allocate the current slab.
[*] - well, it would attempt to allocate a new slab to raise the current
watermark, but failing that it would fail the allocation.
My latest series ensures that SLABs allocated using PF_MEMALLOC will not
distribute objects to allocation contexts that are not entitled for as
long as the memory shortage lasts.
I'm not sure how applicable this is to the problem at hand, just letting
you know whats there.
Relying on this is highly dubious, who is to say that first __GFP_HIGH
alloc came SCSI layer (there could be another merged slab).
Also, when one of these users is PF_MEMALLOC the other users will gobble
up our emergency memory - not as intended.
If this is critical to avoid memory deadlocks, I would suggest using
mempools (or my reserve framework).
--