From 3be2928c4c785194d79e4f92b38f9d829413ff55 Mon Sep 17 00:00:00 2001 From: Alok N Kataria Date: Tue, 27 Sep 2005 21:45:46 -0700 Subject: [PATCH] --- yaml --- r: 9399 b: refs/heads/master c: 5c382300876f2337f7b945c159ffcaf285f296ea h: refs/heads/master i: 9397: 430ff156ef26f08f789ad340160916d630e14fa3 9395: f45fb61ac1d7a25c3750c68ffbdfd0cb9dfa3590 9391: 278fdbe43a15ab4f772a1666054bc60e8128c57f v: v3 --- [refs] | 2 +- trunk/mm/slab.c | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index cf642f5c8753..b7dabad896ab 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0f9578b70a9f112bfb541e1d5ab486a376e64503 +refs/heads/master: 5c382300876f2337f7b945c159ffcaf285f296ea diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c index c9adfce00405..5cbbdfa6dd0e 100644 --- a/trunk/mm/slab.c +++ b/trunk/mm/slab.c @@ -2510,16 +2510,12 @@ cache_alloc_debugcheck_after(kmem_cache_t *cachep, #define cache_alloc_debugcheck_after(a,b,objp,d) (objp) #endif - -static inline void *__cache_alloc(kmem_cache_t *cachep, unsigned int __nocast flags) +static inline void *____cache_alloc(kmem_cache_t *cachep, unsigned int __nocast flags) { - unsigned long save_flags; void* objp; struct array_cache *ac; - cache_alloc_debugcheck_before(cachep, flags); - - local_irq_save(save_flags); + check_irq_off(); ac = ac_data(cachep); if (likely(ac->avail)) { STATS_INC_ALLOCHIT(cachep); @@ -2529,6 +2525,18 @@ static inline void *__cache_alloc(kmem_cache_t *cachep, unsigned int __nocast fl STATS_INC_ALLOCMISS(cachep); objp = cache_alloc_refill(cachep, flags); } + return objp; +} + +static inline void *__cache_alloc(kmem_cache_t *cachep, unsigned int __nocast flags) +{ + unsigned long save_flags; + void* objp; + + cache_alloc_debugcheck_before(cachep, flags); + + local_irq_save(save_flags); + objp = ____cache_alloc(cachep, flags); local_irq_restore(save_flags); objp = cache_alloc_debugcheck_after(cachep, flags, objp, __builtin_return_address(0)); @@ -2856,7 +2864,10 @@ void *kmem_cache_alloc_node(kmem_cache_t *cachep, unsigned int __nocast flags, i cache_alloc_debugcheck_before(cachep, flags); local_irq_save(save_flags); - ptr = __cache_alloc_node(cachep, flags, nodeid); + if (nodeid == numa_node_id()) + ptr = ____cache_alloc(cachep, flags); + else + ptr = __cache_alloc_node(cachep, flags, nodeid); local_irq_restore(save_flags); ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, __builtin_return_address(0));