* linux-next: manual merge of the cgroup tree with the mm-stable, mm-unstable trees
@ 2025-05-21 7:49 Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2025-05-21 7:49 UTC (permalink / raw)
To: Tejun Heo, Andrew Morton
Cc: JP Kobryn, Linux Kernel Mailing List, Linux Next Mailing List,
Shakeel Butt
[-- Attachment #1: Type: text/plain, Size: 1916 bytes --]
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;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* linux-next: manual merge of the cgroup tree with the mm-stable, mm-unstable trees
@ 2025-05-22 7:35 Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2025-05-22 7:35 UTC (permalink / raw)
To: Tejun Heo, Andrew Morton
Cc: JP Kobryn, Linux Kernel Mailing List, Linux Next Mailing List,
Lorenzo Stoakes, Shakeel Butt
[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]
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")
ff9798e05d33 ("memcg: memcg_rstat_updated re-entrant safe against irqs")
from the mm-stable tree,
dc1bc55490f4 ("memcg: make memcg_rstat_updated nmi safe")
from the mm-unstable tree 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 4e9771e6e340,fde0934e2837..000000000000
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@@ -573,22 -582,11 +573,22 @@@ static inline void memcg_rstat_updated(
if (!val)
return;
- 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);
+ /* TODO: add to cgroup update tree once it is nmi-safe. */
+ if (!in_nmi())
- cgroup_rstat_updated(memcg->css.cgroup, cpu);
++ css_rstat_updated(&memcg->css, cpu);
+ 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;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-22 7:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21 7:49 linux-next: manual merge of the cgroup tree with the mm-stable, mm-unstable trees Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2025-05-22 7:35 Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox