Skip to content

Commit

Permalink
[PATCH] mm: optimize numa policy handling in slab allocator
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jan 19, 2006
1 parent dc85da1 commit 86c562a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,9 +982,6 @@ static unsigned interleave_nodes(struct mempolicy *policy)
*/
unsigned slab_node(struct mempolicy *policy)
{
if (in_interrupt())
return numa_node_id();

switch (policy->policy) {
case MPOL_INTERLEAVE:
return interleave_nodes(policy);
Expand Down
2 changes: 1 addition & 1 deletion mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2574,7 +2574,7 @@ static inline void *____cache_alloc(kmem_cache_t *cachep, gfp_t flags)
struct array_cache *ac;

#ifdef CONFIG_NUMA
if (current->mempolicy) {
if (unlikely(current->mempolicy && !in_interrupt())) {
int nid = slab_node(current->mempolicy);

if (nid != numa_node_id())
Expand Down

0 comments on commit 86c562a

Please sign in to comment.