Re: [mm-unstable v4 5/5] mm: memcg: restore subtree stats flushing

From: Waiman Long
Date: Fri Dec 01 2023 - 22:01:21 EST



On 12/1/23 20:57, Bagas Sanjaya wrote:
-void mem_cgroup_flush_stats(void)
+/*
+ * mem_cgroup_flush_stats - flush the stats of a memory cgroup subtree
+ * @memcg: root of the subtree to flush
+ *
+ * Flushing is serialized by the underlying global rstat lock. There is also a
+ * minimum amount of work to be done even if there are no stat updates to flush.
+ * Hence, we only flush the stats if the updates delta exceeds a threshold. This
+ * avoids unnecessary work and contention on the underlying lock.
+ */
What is global rstat lock?

It is the cgroup_rstat_lock in kernel/cgroup/rstat.c.

Cheers,
Longman