Re: [PATCH v3] kmemleaak: survive in a low-memory situation

From: Qian Cai
Date: Tue Mar 26 2019 - 12:28:20 EST




On 3/26/19 12:00 PM, Christopher Lameter wrote:
>> + */
>> + gfp = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC :
>> + gfp_kmemleak_mask(gfp) | __GFP_DIRECT_RECLAIM;
>> + object = kmem_cache_alloc(object_cache, gfp);
>> + }
>> +
>> if (!object) {
>
> If the alloc must succeed then this check is no longer necessary.

Well, GFP_ATOMIC could still fail. It looks like the only thing that will never
fail is (__GFP_DIRECT_RECLAIM | __GFP_NOFAIL) as it keeps retrying in
__alloc_pages_slowpath().