aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux-foundation.org>2010-07-26 11:41:14 -0400
committerPekka Enberg <penberg@cs.helsinki.fi>2010-07-29 05:59:00 -0400
commitbc6488e91078af0b42ee0d8335e0587f64550d7d (patch)
tree9adc2fc7fe0824054679ad273af8fe83be1f8269 /mm/slub.c
parent7adde04a2f5a798f04a556dfb3b69bff388e5dc4 (diff)
slub numa: Fix rare allocation from unexpected node
The network developers have seen sporadic allocations resulting in objects coming from unexpected NUMA nodes despite asking for objects from a specific node. This is due to get_partial() calling get_any_partial() if partial slabs are exhausted for a node even if a node was specified and therefore one would expect allocations only from the specified node. get_any_partial() sporadically may return a slab from a foreign node to gradually reduce the size of partial lists on remote nodes and thereby reduce total memory use for a slab cache. The behavior is controlled by the remote_defrag_ratio of each cache. Strictly speaking this is permitted behavior since __GFP_THISNODE was not specified for the allocation but it is certain surprising. This patch makes sure that the remote defrag behavior only occurs if no node was specified. Signed-off-by: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 578f68f3c51f..39d39653239b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1390,7 +1390,7 @@ static struct page *get_partial(struct kmem_cache *s, gfp_t flags, int node)
1390 int searchnode = (node == -1) ? numa_node_id() : node; 1390 int searchnode = (node == -1) ? numa_node_id() : node;
1391 1391
1392 page = get_partial_node(get_node(s, searchnode)); 1392 page = get_partial_node(get_node(s, searchnode));
1393 if (page || (flags & __GFP_THISNODE)) 1393 if (page || node != -1)
1394 return page; 1394 return page;
1395 1395
1396 return get_any_partial(s, flags); 1396 return get_any_partial(s, flags);