2008-11-19 12:24:22

by OGAWA Hirofumi

[permalink] [raw]
Subject: [PATCH] Add might_sleep_if() for slub

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 <[email protected]>


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

Signed-off-by: OGAWA Hirofumi <[email protected]>
---

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;
_


2008-11-19 19:30:13

by Christoph Lameter

[permalink] [raw]

2008-11-20 09:27:37

by Pekka Enberg

[permalink] [raw]
Subject: Re: [PATCH] Add might_sleep_if() for slub

On Wed, 2008-11-19 at 21:23 +0900, OGAWA Hirofumi wrote:
> 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.

Applied, thanks!