diff options
author | Tejun Heo <tj@kernel.org> | 2014-10-08 12:01:52 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-10-08 12:01:52 -0400 |
commit | 6ae833c7fe0c6ef1f0ab13cc775da230d6f4c256 (patch) | |
tree | 23fc4c7e1ef8a8d97fa039e0da7162c48d08bae7 /mm | |
parent | 17497acbdce9506fd6a75115dee4ab80c3cc5ee5 (diff) |
percpu: fix how @gfp is interpreted by the percpu allocator
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: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/percpu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/percpu.c b/mm/percpu.c index e10f9f7a8887..014bab65e0ff 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -876,7 +876,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, | |||
876 | static int warn_limit = 10; | 876 | static int warn_limit = 10; |
877 | struct pcpu_chunk *chunk; | 877 | struct pcpu_chunk *chunk; |
878 | const char *err; | 878 | const char *err; |
879 | bool is_atomic = !(gfp & GFP_KERNEL); | 879 | bool is_atomic = (gfp & GFP_KERNEL) != GFP_KERNEL; |
880 | int occ_pages = 0; | 880 | int occ_pages = 0; |
881 | int slot, off, new_alloc, cpu, ret; | 881 | int slot, off, new_alloc, cpu, ret; |
882 | unsigned long flags; | 882 | unsigned long flags; |