Skip to content

Commit 21bfe8d

Browse files
danvetakpm00
authored andcommitted
mm/mempool: use might_alloc()
mempool are generally used for GFP_NOIO, so this wont benefit all that much because might_alloc currently only checks GFP_NOFS. But it does validate against mmu notifier pte zapping, some might catch some drivers doing really silly things, plus it's a bit more meaningful in what we're checking for here. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: Vlastimil Babka <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Roman Gushchin <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent a396724 commit 21bfe8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/mempool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask)
379379
gfp_t gfp_temp;
380380

381381
VM_WARN_ON_ONCE(gfp_mask & __GFP_ZERO);
382-
might_sleep_if(gfp_mask & __GFP_DIRECT_RECLAIM);
382+
might_alloc(gfp_mask);
383383

384384
gfp_mask |= __GFP_NOMEMALLOC; /* don't allocate emergency reserves */
385385
gfp_mask |= __GFP_NORETRY; /* don't loop in __alloc_pages */

0 commit comments

Comments
 (0)