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().

Reply via email to