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().
- [PATCH v3] kmemleaak: survive in a low-memory situatio... Qian Cai
- Re: [PATCH v3] kmemleaak: survive in a low-memory... Christopher Lameter
- Re: [PATCH v3] kmemleaak: survive in a low-me... Qian Cai
- Re: [PATCH v3] kmemleaak: survive in a low-memory... Matthew Wilcox
- Re: [PATCH v3] kmemleaak: survive in a low-me... Catalin Marinas
- Re: [PATCH v3] kmemleaak: survive in a lo... Michal Hocko
- Re: [PATCH v3] kmemleaak: survive in a low-memory... Catalin Marinas

