mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Michal Hocko <mhocko@suse.com>
Cc: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>,
	David Hildenbrand <david@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Ben Gardon <bgardon@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Chris Mason <mason@kernel.org>
Subject: Re: [PATCH v2] mm, oom: add rcu_barrier before hiding victim from the oom killer
Date: Sat, 5 Dec 2026 12:50:32 -0800	[thread overview]
Message-ID: <f5304122-a6a3-419d-b0bb-6ee183a39c19@paulmck-laptop> (raw)
In-Reply-To: <0f8b0f83-6b5e-443b-9246-75064f09adc9@paulmck-laptop>

On Fri, Dec 04, 2026 at 08:37:13AM -0800, Paul E. McKenney wrote:
> On Fri, Dec 04, 2026 at 09:24:02AM +0100, Michal Hocko wrote:

[ . . . ]

> > Or pre-allocate so that it doesn't block from inside of the grace
> > period.
> 
> I used to do just that, until we encountered systems whose firmware
> claimed many more CPUs than actually existed, which caused people to
> complain about the resulting useless RCU kthreads.  :-(
> 
> As a result, now many allocations happen when given CPU first comes
> online.
> 
> > Anyway, thanks for the insight. I will drop the barrier from the
> > oom_reaper and also the global memory reclaim 
> > https://lore.kernel.org/all/20261202095450.296675-9-mhocko@kernel.org/T/#u
> 
> Would another approach be to prevent CPU hotplug during reclaim?
> Or at least across the rcu_barrier() call?  No, that just gets us more
> opportunities for deadlock between reclaim and CPU hotplug.  :-(

One thing that can be done with RCU as it exists today is to invoke
start_poll_synchronize_rcu_expedited(), which starts an expedited RCU
grace period.  Given Puranjay Mohan's recent contribution, this will
make RCU callbacks ready to invoke, or at least those that have already
been assigned a grace period.  This function uses queue_work(), but on
a WQ_MEM_RECLAIM workqueue.

If this is useful, it would not be hard to create a function that
assigned all currently queued RCU callbacks to a grace period, and
then invoked start_poll_synchronize_rcu_expedited().  This would
have the effect of an asynchronous counterpart to rcu_barrier().

Would that help?

							Thanx, Paul

  reply	other threads:[~2026-12-05 20:50 UTC|newest]

Thread overview: 30+ 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  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 19:22   ` Harry Yoo
2026-12-02 19:33     ` Michal Hocko
2026-12-02  9:54 ` [PATCH 08/10] mm, " 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 21:21   ` [PATCH v2] " 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-05 20:50                     ` Paul E. McKenney [this message]
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-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=f5304122-a6a3-419d-b0bb-6ee183a39c19@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bgardon@google.com \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mason@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®