Re: [PATCH v2] mm, oom: add rcu_barrier before hiding victim from the oom killer

From: Michal Hocko

Date: Fri Dec 04 2026 - 03:24:08 EST


On Thu 03-12-26 13:36:50, Paul E. McKenney wrote:
> On Thu, Dec 03, 2026 at 09:42:24PM +0100, Michal Hocko wrote:
> > On Thu 03-12-26 12:02:00, Paul E. McKenney wrote:
[...]
> > > And yes, my concern is that RCU grace periods are blocked on reclaim
> > > while reclaim blocks on an RCU grace period. But maybe this code is
> > > guaranteed to run in its own kthreads or similar?
> >
> > Yes, oom_reaper itself is running in a dedicated kernel thread. Is that
> > sufficient? I thought we could have an indirect dependency chain
> >
> > RCU grace period oom_reaper oom_victim
> > allocates memory [blocked]
> > looping in reclaim rcu_barrier();
> > [blocked]
> > MMF_OOM_SKIP
>
> Good point, RCU would need to do non-blocking allocations to avoid
> that dependency chain.

Or pre-allocate so that it doesn't block from inside of the grace
period.

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@xxxxxxxxxx/T/#u

Thanks!
--
Michal Hocko
SUSE Labs