Skip to content
  • Tejun Heo's avatar
    percpu: fix how @gfp is interpreted by the percpu allocator · 6ae833c7
    Tejun Heo authored
    
    
    When @gfp is specified, the percpu allocator is interested in whether
    it contains all of GFP_KERNEL or not.  If it does, the normal
    allocation path is taken; otherwise, the atomic allocation path.
    Unfortunately, pcpu_alloc() was incorrectly testing for whether @gfp
    contains any part of GFP_KERNEL.
    
    Fix it by testing "(gfp & GFP_KERNEL) != GFP_KERNEL" instead of
    "!(gfp & GFP_KERNEL)" to decide whether the allocation should be
    atomic or not.
    
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    6ae833c7