kmemleak not play well with low memory situation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When in low memory situation with swapping, kmemleak quickly disable itself due
to cannot allocate a kmemleak_object structure. If kmemleak could hold a bit
longer, the system will trigger OOM soon to free up the memory. This is a bit
tricky to solve because in __alloc_pages_slowpath() even though it has
GFP_NOFAIL, it would fail allocation due to no GFP_DIRECT_RECLAIM,

/* Caller is not willing to reclaim, we can't balance anything */
if (!can_direct_reclaim)
	goto nopage;

if (WARN_ON_ONCE(!can_direct_reclaim))
	goto fail;

If adding GFP_DIRECT_RECLAIM to kmemleak_alloc(), it will trigger endless
warnings in slab_pre_alloc_hook(),

might_sleep_if(gfpflags_allow_blocking(flags));




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux