Skip to content

Commit 9715dd8

Browse files
committed
mm: memcontrol: use the node-native slab memory counters
Now that the slab counters are moved from the zone to the node level we can drop the private memcg node stats and use the official ones. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Johannes Weiner <[email protected]> Acked-by: Vladimir Davydov <[email protected]> Cc: Josef Bacik <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 44bf960 commit 9715dd8

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

include/linux/memcontrol.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ enum memcg_stat_item {
4444
MEMCG_SOCK,
4545
/* XXX: why are these zone and not node counters? */
4646
MEMCG_KERNEL_STACK_KB,
47-
MEMCG_SLAB_RECLAIMABLE,
48-
MEMCG_SLAB_UNRECLAIMABLE,
4947
MEMCG_NR_STAT,
5048
};
5149

mm/memcontrol.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5198,8 +5198,8 @@ static int memory_stat_show(struct seq_file *m, void *v)
51985198
seq_printf(m, "kernel_stack %llu\n",
51995199
(u64)stat[MEMCG_KERNEL_STACK_KB] * 1024);
52005200
seq_printf(m, "slab %llu\n",
5201-
(u64)(stat[MEMCG_SLAB_RECLAIMABLE] +
5202-
stat[MEMCG_SLAB_UNRECLAIMABLE]) * PAGE_SIZE);
5201+
(u64)(stat[NR_SLAB_RECLAIMABLE] +
5202+
stat[NR_SLAB_UNRECLAIMABLE]) * PAGE_SIZE);
52035203
seq_printf(m, "sock %llu\n",
52045204
(u64)stat[MEMCG_SOCK] * PAGE_SIZE);
52055205

@@ -5223,9 +5223,9 @@ static int memory_stat_show(struct seq_file *m, void *v)
52235223
}
52245224

52255225
seq_printf(m, "slab_reclaimable %llu\n",
5226-
(u64)stat[MEMCG_SLAB_RECLAIMABLE] * PAGE_SIZE);
5226+
(u64)stat[NR_SLAB_RECLAIMABLE] * PAGE_SIZE);
52275227
seq_printf(m, "slab_unreclaimable %llu\n",
5228-
(u64)stat[MEMCG_SLAB_UNRECLAIMABLE] * PAGE_SIZE);
5228+
(u64)stat[NR_SLAB_UNRECLAIMABLE] * PAGE_SIZE);
52295229

52305230
/* Accumulated memory events */
52315231

mm/slab.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static __always_inline int memcg_charge_slab(struct page *page,
287287

288288
memcg_kmem_update_page_stat(page,
289289
(s->flags & SLAB_RECLAIM_ACCOUNT) ?
290-
MEMCG_SLAB_RECLAIMABLE : MEMCG_SLAB_UNRECLAIMABLE,
290+
NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE,
291291
1 << order);
292292
return 0;
293293
}
@@ -300,7 +300,7 @@ static __always_inline void memcg_uncharge_slab(struct page *page, int order,
300300

301301
memcg_kmem_update_page_stat(page,
302302
(s->flags & SLAB_RECLAIM_ACCOUNT) ?
303-
MEMCG_SLAB_RECLAIMABLE : MEMCG_SLAB_UNRECLAIMABLE,
303+
NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE,
304304
-(1 << order));
305305
memcg_kmem_uncharge(page, order);
306306
}

0 commit comments

Comments
 (0)