mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yosry Ahmed <yosry@kernel.org>
To: Richard Chang <richardycc@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Kairui Song <kasong@tencent.com>,  Qi Zheng <qi.zheng@linux.dev>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	 Barry Song <baohua@kernel.org>,
	Axel Rasmussen <axelrasmussen@google.com>,
	 Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	David Hildenbrand <david@kernel.org>,
	Michal Hocko <mhocko@kernel.org>,
	 Lorenzo Stoakes <ljs@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	 "T . J . Mercier" <tjmercier@google.com>,
	Martin Liu <liumartin@google.com>,
	 Minchan Kim <minchan@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: vmscan: abort proactive reclaim early when freezing
Date: Tue, 7 Jul 2026 11:28:29 -0700	[thread overview]
Message-ID: <CAO9r8zOyfXgQoee4c2+G_8whgb6Nq86B_yw0fARwdy=or0uBuQ@mail.gmail.com> (raw)
In-Reply-To: <CALC_0q-9JEbSH8dc0ecMzZU34rjVKzqaFYuoqjP2x8cE3UDo7A@mail.gmail.com>

> On Tue, Jul 7, 2026 at 10:20 AM Yosry Ahmed <yosry@kernel.org> wrote:
> >
> > On Mon, Jul 06, 2026 at 08:12:18AM +0000, Richard Chang wrote:
> > > Proactive reclaim (via memory.reclaim or node reclaim) checks for pending
> > > signals in its outer loop in user_proactive_reclaim(). However, the inner
> > > reclaim loops—scanning cgroups in shrink_many() and evicting folios in
> > > try_to_shrink_lruvec() can run for a long time before returning to the
> > > outer loop, especially on systems with many cgroups or large memory sizes.
> > >
> > > This latency in responding to signals can block the freezer (both cgroup
> > > freezer and system suspend), leading to freezer timeouts. This issue was
> > > specifically observed on Android when attempting to freeze background
> > > cgroups while proactive reclaim was active.
> > >
> > > Add a signal_pending() check to should_abort_scan() for proactive reclaim
> > > paths. Since should_abort_scan() is called within the inner scanning and
> > > eviction loops, this allows proactive reclaim to abort early and return to
> > > the outer loop, ensuring the task can enter the refrigerator in a timely
> > > manner.
> >
> > Do we still need the check in the outer loop?
>
> I believe we still need the outer loop check. Otherwise, we will waste
> CPU cycles entering the inner loop only to bail out.

(Moving your reply after the relevant text, please avoid top-posting:
https://subspace.kernel.org/etiquette.html#do-not-top-post-when-replying).

My question was whether or not it matters in practice, sure we'll
waste some cycles but I don't think it would ultimately matter. That
being said, seems like this change only covers MGLRU, so we still need
the outer check at least for classic LRU.

  reply	other threads:[~2026-07-07 18:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06  8:12 Richard Chang
2026-07-06 12:54 ` Barry Song
2026-07-07  8:00   ` Richard Chang
2026-07-06 23:38 ` Andrew Morton
2026-07-07 10:13   ` Richard Chang
2026-07-07  2:20 ` Yosry Ahmed
2026-07-07  8:04   ` Richard Chang
2026-07-07 18:28     ` Yosry Ahmed [this message]
2026-07-07 19:48 ` Shakeel Butt
2026-07-08  4:14   ` Richard Chang
2026-07-08  4:54     ` Shakeel Butt
2026-07-08  7:24       ` Richard Chang
2026-07-08 15:47         ` Shakeel Butt
2026-07-08 16:03           ` T.J. Mercier
2026-07-08 16:51             ` Shakeel Butt
2026-07-09  7:22               ` [PATCH v2] mm: vmscan: abort proactive reclaim early when freezing for suspend Richard Chang
2026-07-09 12:06                 ` Michal Hocko
2026-07-10  3:29                   ` Richard Chang
2026-07-10  6:27                     ` Michal Hocko
2026-07-14  9:00                       ` Richard Chang
2026-07-14 12:23                         ` Michal Hocko
2026-07-14 12:40                           ` Michal Hocko
2026-07-15  7:56                             ` Richard Chang
2026-07-15  8:49                               ` Michal Hocko
2026-07-15 17:47                                 ` Oleg Nesterov
2026-07-15 19:58                                   ` Michal Hocko
2026-07-17  9:14                                     ` Richard Chang
2026-07-17 18:12                                       ` [PATCH v3] " Richard Chang
2026-07-17 18:47                                         ` Oleg Nesterov

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='CAO9r8zOyfXgQoee4c2+G_8whgb6Nq86B_yw0fARwdy=or0uBuQ@mail.gmail.com' \
    --to=yosry@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liumartin@google.com \
    --cc=ljs@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=minchan@kernel.org \
    --cc=qi.zheng@linux.dev \
    --cc=richardycc@google.com \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=tjmercier@google.com \
    --cc=weixugc@google.com \
    --cc=yuanchu@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