Commit 86c562a9 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

[PATCH] mm: optimize numa policy handling in slab allocator

Move the interrupt check from slab_node into ___cache_alloc and adds an
"unlikely()" to avoid pipeline stalls on some architectures.
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent dc85da15
...@@ -982,9 +982,6 @@ static unsigned interleave_nodes(struct mempolicy *policy) ...@@ -982,9 +982,6 @@ static unsigned interleave_nodes(struct mempolicy *policy)
*/ */
unsigned slab_node(struct mempolicy *policy) unsigned slab_node(struct mempolicy *policy)
{ {
if (in_interrupt())
return numa_node_id();
switch (policy->policy) { switch (policy->policy) {
case MPOL_INTERLEAVE: case MPOL_INTERLEAVE:
return interleave_nodes(policy); return interleave_nodes(policy);
......
...@@ -2574,7 +2574,7 @@ static inline void *____cache_alloc(kmem_cache_t *cachep, gfp_t flags) ...@@ -2574,7 +2574,7 @@ static inline void *____cache_alloc(kmem_cache_t *cachep, gfp_t flags)
struct array_cache *ac; struct array_cache *ac;
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
if (current->mempolicy) { if (unlikely(current->mempolicy && !in_interrupt())) {
int nid = slab_node(current->mempolicy); int nid = slab_node(current->mempolicy);
if (nid != numa_node_id()) if (nid != numa_node_id())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment