slub: Add might_sleep_if() to slab_alloc()

Currently SLUB doesn't warn about __GFP_WAIT. Add it into slab_alloc().

Acked-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
OGAWA Hirofumi 2008-11-19 21:23:59 +09:00 committed by Pekka Enberg
parent 3c92ec8ae9
commit 89124d706d
1 changed files with 1 additions and 0 deletions

View File

@ -1591,6 +1591,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
unsigned long flags;
unsigned int objsize;
might_sleep_if(gfpflags & __GFP_WAIT);
local_irq_save(flags);
c = get_cpu_slab(s, smp_processor_id());
objsize = c->objsize;