Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=824ebef122153a03925ae0ed211b4e8568d1c8db
Commit:     824ebef122153a03925ae0ed211b4e8568d1c8db
Parent:     f0f3980b21508bd573eff1746d469436f50a903d
Author:     Akinobu Mita <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 14:49:58 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon May 7 12:12:55 2007 -0700

    fault injection: fix failslab with CONFIG_NUMA
    
    Currently failslab injects failures into ____cache_alloc().  But with 
enabling
    CONFIG_NUMA it's not enough to let actual slab allocator functions (kmalloc,
    kmem_cache_alloc, ...) return NULL.
    
    This patch moves fault injection hook inside of __cache_alloc() and
    __cache_alloc_node().  These are lower call path than ____cache_alloc() and
    enable to inject faulures to slab allocators with CONFIG_NUMA.
    
    Acked-by: Pekka Enberg <[EMAIL PROTECTED]>
    Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
    Cc: Christoph Lameter <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/slab.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 583644f..2a3cbd6 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3170,7 +3170,7 @@ static int __init failslab_debugfs(void)
        struct dentry *dir;
        int err;
 
-               err = init_fault_attr_dentries(&failslab.attr, "failslab");
+       err = init_fault_attr_dentries(&failslab.attr, "failslab");
        if (err)
                return err;
        dir = failslab.attr.dentries.dir;
@@ -3208,9 +3208,6 @@ static inline void *____cache_alloc(struct kmem_cache 
*cachep, gfp_t flags)
 
        check_irq_off();
 
-       if (should_failslab(cachep, flags))
-               return NULL;
-
        ac = cpu_cache_get(cachep);
        if (likely(ac->avail)) {
                STATS_INC_ALLOCHIT(cachep);
@@ -3402,6 +3399,9 @@ __cache_alloc_node(struct kmem_cache *cachep, gfp_t 
flags, int nodeid,
        unsigned long save_flags;
        void *ptr;
 
+       if (should_failslab(cachep, flags))
+               return NULL;
+
        cache_alloc_debugcheck_before(cachep, flags);
        local_irq_save(save_flags);
 
@@ -3472,6 +3472,9 @@ __cache_alloc(struct kmem_cache *cachep, gfp_t flags, 
void *caller)
        unsigned long save_flags;
        void *objp;
 
+       if (should_failslab(cachep, flags))
+               return NULL;
+
        cache_alloc_debugcheck_before(cachep, flags);
        local_irq_save(save_flags);
        objp = __do_cache_alloc(cachep, flags);
-
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