forked from mirrors/linux
		
	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>
This commit is contained in:
		
							parent
							
								
									17497acbdc
								
							
						
					
					
						commit
						6ae833c7fe
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -876,7 +876,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, | ||||||
| 	static int warn_limit = 10; | 	static int warn_limit = 10; | ||||||
| 	struct pcpu_chunk *chunk; | 	struct pcpu_chunk *chunk; | ||||||
| 	const char *err; | 	const char *err; | ||||||
| 	bool is_atomic = !(gfp & GFP_KERNEL); | 	bool is_atomic = (gfp & GFP_KERNEL) != GFP_KERNEL; | ||||||
| 	int occ_pages = 0; | 	int occ_pages = 0; | ||||||
| 	int slot, off, new_alloc, cpu, ret; | 	int slot, off, new_alloc, cpu, ret; | ||||||
| 	unsigned long flags; | 	unsigned long flags; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Tejun Heo
						Tejun Heo