Re: [PATCH 08/10] mm, oom: wait for rcu_call callbacks before retrying reclaim

From: Michal Hocko

Date: Fri Dec 04 2026 - 03:39:23 EST


I am dropping this patch based on discussion with Paul and conclusion
reached in https://lore.kernel.org/all/ed6c5f64-7afe-45a2-8d18-e4e1c0052840@paulmck-laptop/T/#u

On Wed 02-12-26 10:54:01, Michal Hocko wrote:
> From: Michal Hocko <mhocko@xxxxxxxx>
>
> Memory reclaim can miss quite a lot of pages freed through call_rcu
> because it itself doen't trigger RCU grace period. cond_resched() is not
> sufficient for that. Call rcu_barrier to wait for those callbacks to
> execute before retrying the reclaim loop again.
>
> Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>
> ---
> mm/page_alloc.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 6624293e4d78..399a7682b2c9 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -4701,6 +4701,9 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,
> schedule_timeout_uninterruptible(1);
> else
> cond_resched();
> +
> + /* Wait for any potential call_rcu memory freers */
> + rcu_barrier();
> out:
> /* Before OOM, exhaust highatomic_reserve */
> if (!ret)
> --
> 2.56.1
>

--
Michal Hocko
SUSE Labs