The quilt patch titled Subject: mm: memcg: remove stats flushing mutex has been removed from the -mm tree. Its filename was mm-memcg-restore-subtree-stats-flushing-fix-2.patch This patch was dropped because it was folded into mm-memcg-restore-subtree-stats-flushing.patch ------------------------------------------------------ From: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Subject: mm: memcg: remove stats flushing mutex Date: Mon, 4 Dec 2023 23:43:29 +0000 The mutex was intended to make the waiters sleep instead of spin, and such that we can check the update thresholds again after acquiring the mutex. However, the mutex has a risk of priority inversion, especially since the underlying rstat lock can de dropped while the mutex is held. Synthetic testing with high concurrency of flushers shows no regressions without the mutex, so remove it. Link: https://lkml.kernel.org/r/CAJD7tkZgP3m-VVPn+fF_YuvXeQYK=tZZjJHj=dzD=CcSSpp2qg@xxxxxxxxxxxxxx Signed-off-by: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Suggested-by: Shakeel Butt <shakeelb@xxxxxxxxxx> Acked-by: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: Chris Li <chrisl@xxxxxxxxxx> Cc: Domenico Cerasuolo <cerasuolodomenico@xxxxxxxxx> Cc: Greg Thelen <gthelen@xxxxxxxxxx> Cc: Ivan Babrou <ivan@xxxxxxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Michal Koutny <mkoutny@xxxxxxxx> Cc: Muchun Song <muchun.song@xxxxxxxxx> Cc: Roman Gushchin <roman.gushchin@xxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Cc: Waiman Long <longman@xxxxxxxxxx> Cc: Wei Xu <weixugc@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) --- a/mm/memcontrol.c~mm-memcg-restore-subtree-stats-flushing-fix-2 +++ a/mm/memcontrol.c @@ -749,21 +749,14 @@ static void do_flush_stats(struct mem_cg */ void mem_cgroup_flush_stats(struct mem_cgroup *memcg) { - static DEFINE_MUTEX(memcg_stats_flush_mutex); - if (mem_cgroup_disabled()) return; if (!memcg) memcg = root_mem_cgroup; - if (memcg_should_flush_stats(memcg)) { - mutex_lock(&memcg_stats_flush_mutex); - /* Check again after locking, another flush may have occurred */ - if (memcg_should_flush_stats(memcg)) - do_flush_stats(memcg); - mutex_unlock(&memcg_stats_flush_mutex); - } + if (memcg_should_flush_stats(memcg)) + do_flush_stats(memcg); } void mem_cgroup_flush_stats_ratelimited(struct mem_cgroup *memcg) _ Patches currently in -mm which might be from yosryahmed@xxxxxxxxxx are mm-memcg-change-flush_next_time-to-flush_last_time.patch mm-memcg-move-vmstats-structs-definition-above-flushing-code.patch mm-memcg-make-stats-flushing-threshold-per-memcg.patch mm-workingset-move-the-stats-flush-into-workingset_test_recent.patch mm-memcg-restore-subtree-stats-flushing.patch