From: sashiko-bot@kernel.org
To: "Michal Hocko" <mhocko@kernel.org>,
"David Hildenbrand" <david@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Cc: "David Rientjes" <rientjes@google.com>,
"Ben Gardon" <bgardon@google.com>,
"Johannes Weiner" <hannes@cmpxchg.org>,
linux-mm@kvack.org, "Michal Hocko" <mhocko@suse.com>,
"Chris Mason" <mason@kernel.org>
Subject: Re: [PATCH v3] mm, oom: move MMF_OOM_SKIP after page table releasing in exit_mmap
Date: Sat, 05 Dec 2026 09:08:49 +0000 [thread overview]
Message-ID: <sashiko-outbox-251335@kernel.org> (raw)
In-Reply-To: <20261204090827.568530-1-mhocko@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mm: unconditional rcu_barrier() in exit_mmap() causes
host-wide IPI fan-out
--
commit 9787fa5ac768ab0418163ad0ad5fc79777504b21
Author: Michal Hocko <mhocko@suse.com>
mm, oom: move MMF_OOM_SKIP after page table releasing in exit_mmap
This commit moves mm_flags_set(MMF_OOM_SKIP, mm) in exit_mmap() to run
after free_pgtables() and tlb_finish_mmu(), adding an rcu_barrier() for
OOM victims before setting MMF_OOM_SKIP.
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 43e2a1ede9b84..754e3efa73666 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
[ ... ]
> @@ -1334,6 +1326,14 @@ void exit_mmap(struct mm_struct *mm)
> free_pgtables(&tlb, &unmap);
> tlb_finish_mmu(&tlb);
>
> + /*
> + * Free the memory before marking MMF_OOM_SKIP so a re-triggered OOM
> + * killer will only skip this mm if it's already freed all it can.
> + */
> + if (mm_is_oom_victim(mm))
> + rcu_barrier();
> + mm_flags_set(MMF_OOM_SKIP, mm);
[Severity: Medium]
Can calling rcu_barrier() unconditionally here cause host-wide IPI storms
under memcg OOMs?
rcu_barrier() serializes on the global rcu_state.barrier_mutex, sends a
synchronous cross-CPU IPI to every online CPU with pending callbacks
(including nohz_full and rcu_nocbs CPUs), and flushes bypass queues,
hurrying CONFIG_RCU_LAZY callbacks host-wide.
Because memcg OOM kills are not rate-limited and mark_oom_victim() sets
MMF_OOM_VICTIM on every victim, an unprivileged workload in a
memory-limited cgroup (especially with memory.oom.group=1) can trigger
repeated host-wide rcu_barrier() waves as tasks exit.
This also runs when MMF_OOM_SKIP is already set (such as by
oom_reap_task()) or when free_pgtables() queued no RCU-deferred page-table
frees. Skipping rcu_barrier() in those cases, or using
rcu_barrier_throttled(), would avoid unnecessary global barriers.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204090827.568530-1-mhocko@kernel.org?part=1
next prev parent reply other threads:[~2026-12-05 9:08 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 9:53 [PATCH 0/10] assorted oom fixes Michal Hocko
2026-12-02 9:53 ` [PATCH 01/10] memcg-v1, oom: do not sleep in worker contexts Michal Hocko
2026-12-02 20:21 ` Joshua Hahn
2026-12-02 21:28 ` Michal Hocko
2026-12-02 9:53 ` [PATCH 02/10] mm/oom_kill: keep the allocating mm eligible Michal Hocko
2026-12-02 9:53 ` [PATCH 03/10] mm, oom: do not panic on constrained OOMs Michal Hocko
2026-12-02 9:53 ` [PATCH 04/10] mm/oom_kill: ratelimit memcg OOM reports with no victim Michal Hocko
2026-12-02 9:53 ` [PATCH 05/10] mm, oom: thaw tasks sharing the mm with the oom victim Michal Hocko
2026-12-02 16:30 ` sashiko-bot
2026-12-02 19:23 ` Michal Hocko
2026-12-02 9:53 ` [PATCH 06/10] mm, oom: check oom victims prior to numa placement Michal Hocko
2026-12-02 9:54 ` [PATCH 07/10] memcg, oom: wait for rcu_call callbacks before retrying reclaim Michal Hocko
2026-12-02 16:31 ` sashiko-bot
2026-12-02 19:38 ` Michal Hocko
2026-12-02 19:22 ` Harry Yoo
2026-12-02 19:33 ` Michal Hocko
2026-12-02 9:54 ` [PATCH 08/10] mm, " Michal Hocko
2026-12-02 16:31 ` sashiko-bot
2026-12-02 19:44 ` Michal Hocko
2026-12-04 8:39 ` Michal Hocko
2026-12-02 9:54 ` [PATCH 09/10] mm, oom: add rcu_barrier before hiding victim from the oom killer Michal Hocko
2026-12-02 16:31 ` sashiko-bot
2026-12-02 19:53 ` Michal Hocko
2026-12-02 19:57 ` Lorenzo Stoakes (ARM)
2026-12-02 21:21 ` [PATCH v2] " Michal Hocko
2026-12-02 22:08 ` sashiko-bot
2026-12-03 8:46 ` Michal Hocko
2026-12-04 4:06 ` Liam R. Howlett
2026-12-04 8:20 ` Michal Hocko
2026-12-03 12:24 ` Lorenzo Stoakes (ARM)
2026-12-03 17:39 ` Paul E. McKenney
2026-12-03 18:11 ` Michal Hocko
2026-12-03 20:02 ` Paul E. McKenney
2026-12-03 20:42 ` Michal Hocko
2026-12-03 21:36 ` Paul E. McKenney
2026-12-04 8:24 ` Michal Hocko
2026-12-04 16:37 ` Paul E. McKenney
2026-12-04 9:08 ` [PATCH v3] mm, oom: move MMF_OOM_SKIP after page table releasing in exit_mmap Michal Hocko
2026-12-04 9:26 ` Lorenzo Stoakes (ARM)
2026-12-05 9:08 ` sashiko-bot [this message]
2026-12-02 9:54 ` [PATCH 10/10] memcg: wake v1 OOM lock contenders on unlock Michal Hocko
2026-12-02 13:06 ` [PATCH 0/10] assorted oom fixes David Hildenbrand (Arm)
2026-12-02 19:01 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-251335@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bgardon@google.com \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mason@kernel.org \
--cc=mhocko@kernel.org \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.