Skip to content

Commit 8dcb0ed

Browse files
shakeelbhtejun
authored andcommitted
memcg: cgroup: call css_rstat_updated irrespective of in_nmi()
css_rstat_updated() is nmi safe, so there is no need to avoid it in in_nmi(), so remove the check. Signed-off-by: Shakeel Butt <[email protected]> Tested-by: JP Kobryn <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 6af89c6 commit 8dcb0ed

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mm/memcontrol.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,7 @@ static inline void memcg_rstat_updated(struct mem_cgroup *memcg, int val,
573573
if (!val)
574574
return;
575575

576-
/* TODO: add to cgroup update tree once it is nmi-safe. */
577-
if (!in_nmi())
578-
css_rstat_updated(&memcg->css, cpu);
576+
css_rstat_updated(&memcg->css, cpu);
579577
statc_pcpu = memcg->vmstats_percpu;
580578
for (; statc_pcpu; statc_pcpu = statc->parent_pcpu) {
581579
statc = this_cpu_ptr(statc_pcpu);
@@ -2530,7 +2528,8 @@ static inline void account_slab_nmi_safe(struct mem_cgroup *memcg,
25302528
} else {
25312529
struct mem_cgroup_per_node *pn = memcg->nodeinfo[pgdat->node_id];
25322530

2533-
/* TODO: add to cgroup update tree once it is nmi-safe. */
2531+
/* preemption is disabled in_nmi(). */
2532+
css_rstat_updated(&memcg->css, smp_processor_id());
25342533
if (idx == NR_SLAB_RECLAIMABLE_B)
25352534
atomic_add(nr, &pn->slab_reclaimable);
25362535
else
@@ -2753,7 +2752,8 @@ static inline void account_kmem_nmi_safe(struct mem_cgroup *memcg, int val)
27532752
if (likely(!in_nmi())) {
27542753
mod_memcg_state(memcg, MEMCG_KMEM, val);
27552754
} else {
2756-
/* TODO: add to cgroup update tree once it is nmi-safe. */
2755+
/* preemption is disabled in_nmi(). */
2756+
css_rstat_updated(&memcg->css, smp_processor_id());
27572757
atomic_add(val, &memcg->kmem_stat);
27582758
}
27592759
}

0 commit comments

Comments
 (0)