[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250521174958.0b7354da@canb.auug.org.au>
Date: Wed, 21 May 2025 17:49:58 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Tejun Heo <tj@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>
Cc: JP Kobryn <inwardvessel@...il.com>, Linux Kernel Mailing List
<linux-kernel@...r.kernel.org>, Linux Next Mailing List
<linux-next@...r.kernel.org>, Shakeel Butt <shakeel.butt@...ux.dev>
Subject: linux-next: manual merge of the cgroup tree with the mm-stable,
mm-unstable trees
Hi all,
Today's linux-next merge of the cgroup tree got a conflict in:
mm/memcontrol.c
between commits:
60cada258dfe ("memcg: optimize memcg_rstat_updated")
from the mm-stable tree and
d826d981051a ("memcg: memcg_rstat_updated re-entrant safe against irqs")
from the mm-unstable trees and commit:
a97915559f5c ("cgroup: change rstat function signatures from cgroup-based to css-based")
from the cgroup tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc mm/memcontrol.c
index e936f6651f47,fde0934e2837..000000000000
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@@ -573,20 -582,11 +573,20 @@@ static inline void memcg_rstat_updated(
if (!val)
return;
- cgroup_rstat_updated(memcg->css.cgroup, cpu);
+ css_rstat_updated(&memcg->css, cpu);
- statc = this_cpu_ptr(memcg->vmstats_percpu);
- for (; statc; statc = statc->parent) {
- stats_updates = READ_ONCE(statc->stats_updates) + abs(val);
- WRITE_ONCE(statc->stats_updates, stats_updates);
+ statc_pcpu = memcg->vmstats_percpu;
+ for (; statc_pcpu; statc_pcpu = statc->parent_pcpu) {
+ statc = this_cpu_ptr(statc_pcpu);
+ /*
+ * If @memcg is already flushable then all its ancestors are
+ * flushable as well and also there is no need to increase
+ * stats_updates.
+ */
+ if (memcg_vmstats_needs_flush(statc->vmstats))
+ break;
+
+ stats_updates = this_cpu_add_return(statc_pcpu->stats_updates,
+ abs(val));
if (stats_updates < MEMCG_CHARGE_BATCH)
continue;
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists