lkml.org 
[lkml]   [2015]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] um: net: replace GFP_KERNEL with GFP_ATOMIC when spinlock is held
From
Date
Am 29.10.2015 um 15:50 schrieb Joe Perches:
> On Thu, 2015-10-29 at 14:46 +0530, Saurabh Sengar wrote:
>> replace GFP_KERNEL with GFP_ATOMIC while spinlock is held,
>> as code while holding a spinlock should be atomic.
>> GFP_KERNEL may sleep and can cause deadlock,
>> where as GFP_ATOMIC may fail but certainly avoids deadlock
>>
>> Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
>> ---
>> v3: removed the atomic variable, as per Richard comment
>
> Trivia: You could remove the gfp_mask variables too
> and just use GFP_KERNEL and GFP_ATOMIC directly.

Yep.
And "int gfp_mask" does also not make sense, GFP_* is of type
gfp_t.

Thanks,
//richard


\
 
 \ /
  Last update: 2015-10-29 16:21    [W:0.042 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site