diff options
author | Christoph Lameter <clameter@engr.sgi.com> | 2006-01-18 20:42:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-18 22:20:18 -0500 |
commit | 86c562a9d6683063e071692fe14e0a18e64ee1be (patch) | |
tree | dd64f8bff4624f17f2245aeadf962e0d6d5974a0 | |
parent | dc85da15d42b0efc792b0f5eab774dc5dbc1ceec (diff) |
[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: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | mm/mempolicy.c | 3 | ||||
-rw-r--r-- | mm/slab.c | 2 |
2 files changed, 1 insertions, 4 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 71430d440822..73790188b0eb 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -982,9 +982,6 @@ static unsigned interleave_nodes(struct mempolicy *policy) | |||
982 | */ | 982 | */ |
983 | unsigned slab_node(struct mempolicy *policy) | 983 | unsigned slab_node(struct mempolicy *policy) |
984 | { | 984 | { |
985 | if (in_interrupt()) | ||
986 | return numa_node_id(); | ||
987 | |||
988 | switch (policy->policy) { | 985 | switch (policy->policy) { |
989 | case MPOL_INTERLEAVE: | 986 | case MPOL_INTERLEAVE: |
990 | return interleave_nodes(policy); | 987 | return interleave_nodes(policy); |
@@ -2574,7 +2574,7 @@ static inline void *____cache_alloc(kmem_cache_t *cachep, gfp_t flags) | |||
2574 | struct array_cache *ac; | 2574 | struct array_cache *ac; |
2575 | 2575 | ||
2576 | #ifdef CONFIG_NUMA | 2576 | #ifdef CONFIG_NUMA |
2577 | if (current->mempolicy) { | 2577 | if (unlikely(current->mempolicy && !in_interrupt())) { |
2578 | int nid = slab_node(current->mempolicy); | 2578 | int nid = slab_node(current->mempolicy); |
2579 | 2579 | ||
2580 | if (nid != numa_node_id()) | 2580 | if (nid != numa_node_id()) |