aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/slub_def.h1
-rw-r--r--mm/slub.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index b42715294147..5b228b785377 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -24,6 +24,7 @@ enum stat_item {
24 ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */ 24 ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */
25 ALLOC_SLAB, /* Cpu slab acquired from page allocator */ 25 ALLOC_SLAB, /* Cpu slab acquired from page allocator */
26 ALLOC_REFILL, /* Refill cpu slab from slab freelist */ 26 ALLOC_REFILL, /* Refill cpu slab from slab freelist */
27 ALLOC_NODE_MISMATCH, /* Switching cpu slab */
27 FREE_SLAB, /* Slab freed to the page allocator */ 28 FREE_SLAB, /* Slab freed to the page allocator */
28 CPUSLAB_FLUSH, /* Abandoning of the cpu slab */ 29 CPUSLAB_FLUSH, /* Abandoning of the cpu slab */
29 DEACTIVATE_FULL, /* Cpu slab was full when deactivated */ 30 DEACTIVATE_FULL, /* Cpu slab was full when deactivated */
diff --git a/mm/slub.c b/mm/slub.c
index 41a15c1d8068..e00b7732f556 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1966,6 +1966,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
1966 goto new_slab; 1966 goto new_slab;
1967 1967
1968 if (unlikely(!node_match(c, node))) { 1968 if (unlikely(!node_match(c, node))) {
1969 stat(s, ALLOC_NODE_MISMATCH);
1969 deactivate_slab(s, c); 1970 deactivate_slab(s, c);
1970 goto new_slab; 1971 goto new_slab;
1971 } 1972 }
@@ -4671,6 +4672,7 @@ STAT_ATTR(FREE_REMOVE_PARTIAL, free_remove_partial);
4671STAT_ATTR(ALLOC_FROM_PARTIAL, alloc_from_partial); 4672STAT_ATTR(ALLOC_FROM_PARTIAL, alloc_from_partial);
4672STAT_ATTR(ALLOC_SLAB, alloc_slab); 4673STAT_ATTR(ALLOC_SLAB, alloc_slab);
4673STAT_ATTR(ALLOC_REFILL, alloc_refill); 4674STAT_ATTR(ALLOC_REFILL, alloc_refill);
4675STAT_ATTR(ALLOC_NODE_MISMATCH, alloc_node_mismatch);
4674STAT_ATTR(FREE_SLAB, free_slab); 4676STAT_ATTR(FREE_SLAB, free_slab);
4675STAT_ATTR(CPUSLAB_FLUSH, cpuslab_flush); 4677STAT_ATTR(CPUSLAB_FLUSH, cpuslab_flush);
4676STAT_ATTR(DEACTIVATE_FULL, deactivate_full); 4678STAT_ATTR(DEACTIVATE_FULL, deactivate_full);
@@ -4730,6 +4732,7 @@ static struct attribute *slab_attrs[] = {
4730 &alloc_from_partial_attr.attr, 4732 &alloc_from_partial_attr.attr,
4731 &alloc_slab_attr.attr, 4733 &alloc_slab_attr.attr,
4732 &alloc_refill_attr.attr, 4734 &alloc_refill_attr.attr,
4735 &alloc_node_mismatch_attr.attr,
4733 &free_slab_attr.attr, 4736 &free_slab_attr.attr,
4734 &cpuslab_flush_attr.attr, 4737 &cpuslab_flush_attr.attr,
4735 &deactivate_full_attr.attr, 4738 &deactivate_full_attr.attr,