[PATCH] Add might_sleep_if() for slub

From: OGAWA Hirofumi
Date: Wed Nov 19 2008 - 07:24:23 EST


Hi,

I don't know it is intention, or not. However, current SLUB not seems to
warn about might_sleep_if(gfpflags & __GFP_WAIT);

If it's not intention, please apply.
--
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>


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

Signed-off-by: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
---

mm/slub.c | 1 +
1 file changed, 1 insertion(+)

diff -puN mm/slub.c~slub-might-sleep mm/slub.c
--- linux-2.6/mm/slub.c~slub-might-sleep 2008-11-19 20:57:28.000000000 +0900
+++ linux-2.6-hirofumi/mm/slub.c 2008-11-19 20:57:28.000000000 +0900
@@ -1591,6 +1591,7 @@ static __always_inline void *slab_alloc(
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;
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/