linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [git pull] slub fallback fix
@ 2008-03-17 18:43 Christoph Lameter
  2008-03-18 14:42 ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2008-03-17 18:43 UTC (permalink / raw)
  To: torvalds; +Cc: linux-mm, akpm, Pekka Enberg, Matt Mackall

We need to reenable interrupts before calling the page allocator from the
fallback path for kmalloc. Used to be okay with the alternate fastpath 
which shifted interrupt enable/disable to the fastpath. But the slowpath
is always called with interrupts disabled now. So we need this fix.


  git://git.kernel.org/pub/scm/linux/kernel/git/christoph/vm.git slab-linus

Christoph Lameter (1):
      slub page alloc fallback: Enable interrupts for GFP_WAIT.

 mm/slub.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 96d63eb..ca71d5b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1536,9 +1536,15 @@ new_slab:
         * That is only possible if certain conditions are met that are 
being
         * checked when a slab is created.
         */
-       if (!(gfpflags & __GFP_NORETRY) && (s->flags & 
__PAGE_ALLOC_FALLBACK))
-               return kmalloc_large(s->objsize, gfpflags);
-
+       if (!(gfpflags & __GFP_NORETRY) &&
+                               (s->flags & __PAGE_ALLOC_FALLBACK)) {
+               if (gfpflags & __GFP_WAIT)
+                       local_irq_enable();
+               object = kmalloc_large(s->objsize, gfpflags);
+               if (gfpflags & __GFP_WAIT)
+                       local_irq_disable();
+               return object;
+       }
        return NULL;
 debug:
        if (!alloc_debug_processing(s, c->page, object, addr))

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-19  4:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-17 18:43 [git pull] slub fallback fix Christoph Lameter
2008-03-18 14:42 ` Linus Torvalds
2008-03-18 17:42   ` Christoph Lameter
2008-03-18 18:25     ` Linus Torvalds
2008-03-18 18:45       ` Christoph Lameter
2008-03-19  4:13         ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox