Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dd47ea755693228bf842c779e8afdfa47efb20a3
Commit:     dd47ea755693228bf842c779e8afdfa47efb20a3
Parent:     6a8ba9d12150461acc91bd3c9124eac19e853218
Author:     Christoph Lameter <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 13 00:34:11 2006 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Dec 13 09:05:48 2006 -0800

    [PATCH] slab: fix sleeping in atomic bug
    
    Fallback_alloc() does not do the check for GFP_WAIT as done in
    cache_grow().  Thus interrupts are disabled when we call kmem_getpages()
    which results in the failure.
    
    Duplicate the handling of GFP_WAIT in cache_grow().
    
    Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]>
    Cc: Jay Cliburn <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/slab.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 2c65553..c7576b9 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3252,6 +3252,7 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t 
flags)
        struct zone **z;
        void *obj = NULL;
        int nid;
+       gfp_t local_flags = (flags & GFP_LEVEL_MASK);
 
 retry:
        /*
@@ -3275,7 +3276,12 @@ retry:
                 * We may trigger various forms of reclaim on the allowed
                 * set and go into memory reserves if necessary.
                 */
+               if (local_flags & __GFP_WAIT)
+                       local_irq_enable();
+               kmem_flagcheck(cache, flags);
                obj = kmem_getpages(cache, flags, -1);
+               if (local_flags & __GFP_WAIT)
+                       local_irq_disable();
                if (obj) {
                        /*
                         * Insert into the appropriate per node queues
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to