From 70b9c77746c95611651a1607ee8d6c47f752b224 Mon Sep 17 00:00:00 2001 From: "Siddha, Suresh B" Date: Wed, 22 Aug 2007 14:01:49 -0700 Subject: [PATCH] --- yaml --- r: 64252 b: refs/heads/master c: 1807a1aaf5f2a35ea6d4b527b28bc8889d255a2f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/slab.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index c3b586d08033..78eaf57fca39 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 32d219854d31daba3407389ada1d454a4cd86fda +refs/heads/master: 1807a1aaf5f2a35ea6d4b527b28bc8889d255a2f diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c index a684778b2b41..6f6abef83a1a 100644 --- a/trunk/mm/slab.c +++ b/trunk/mm/slab.c @@ -883,6 +883,7 @@ static void __slab_error(const char *function, struct kmem_cache *cachep, */ static int use_alien_caches __read_mostly = 1; +static int numa_platform __read_mostly = 1; static int __init noaliencache_setup(char *s) { use_alien_caches = 0; @@ -1399,8 +1400,10 @@ void __init kmem_cache_init(void) int order; int node; - if (num_possible_nodes() == 1) + if (num_possible_nodes() == 1) { use_alien_caches = 0; + numa_platform = 0; + } for (i = 0; i < NUM_INIT_LISTS; i++) { kmem_list3_init(&initkmem_list3[i]); @@ -3558,7 +3561,14 @@ static inline void __cache_free(struct kmem_cache *cachep, void *objp) check_irq_off(); objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0)); - if (cache_free_alien(cachep, objp)) + /* + * Skip calling cache_free_alien() when the platform is not numa. + * This will avoid cache misses that happen while accessing slabp (which + * is per page memory reference) to get nodeid. Instead use a global + * variable to skip the call, which is mostly likely to be present in + * the cache. + */ + if (numa_platform && cache_free_alien(cachep, objp)) return; if (likely(ac->avail < ac->limit)) {