diff options
-rw-r--r-- | mm/slab.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -883,6 +883,7 @@ static void __slab_error(const char *function, struct kmem_cache *cachep, | |||
883 | */ | 883 | */ |
884 | 884 | ||
885 | static int use_alien_caches __read_mostly = 1; | 885 | static int use_alien_caches __read_mostly = 1; |
886 | static int numa_platform __read_mostly = 1; | ||
886 | static int __init noaliencache_setup(char *s) | 887 | static int __init noaliencache_setup(char *s) |
887 | { | 888 | { |
888 | use_alien_caches = 0; | 889 | use_alien_caches = 0; |
@@ -1399,8 +1400,10 @@ void __init kmem_cache_init(void) | |||
1399 | int order; | 1400 | int order; |
1400 | int node; | 1401 | int node; |
1401 | 1402 | ||
1402 | if (num_possible_nodes() == 1) | 1403 | if (num_possible_nodes() == 1) { |
1403 | use_alien_caches = 0; | 1404 | use_alien_caches = 0; |
1405 | numa_platform = 0; | ||
1406 | } | ||
1404 | 1407 | ||
1405 | for (i = 0; i < NUM_INIT_LISTS; i++) { | 1408 | for (i = 0; i < NUM_INIT_LISTS; i++) { |
1406 | kmem_list3_init(&initkmem_list3[i]); | 1409 | kmem_list3_init(&initkmem_list3[i]); |
@@ -3558,7 +3561,14 @@ static inline void __cache_free(struct kmem_cache *cachep, void *objp) | |||
3558 | check_irq_off(); | 3561 | check_irq_off(); |
3559 | objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0)); | 3562 | objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0)); |
3560 | 3563 | ||
3561 | if (cache_free_alien(cachep, objp)) | 3564 | /* |
3565 | * Skip calling cache_free_alien() when the platform is not numa. | ||
3566 | * This will avoid cache misses that happen while accessing slabp (which | ||
3567 | * is per page memory reference) to get nodeid. Instead use a global | ||
3568 | * variable to skip the call, which is mostly likely to be present in | ||
3569 | * the cache. | ||
3570 | */ | ||
3571 | if (numa_platform && cache_free_alien(cachep, objp)) | ||
3562 | return; | 3572 | return; |
3563 | 3573 | ||
3564 | if (likely(ac->avail < ac->limit)) { | 3574 | if (likely(ac->avail < ac->limit)) { |