From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFE8D2D0C72 for ; Mon, 6 Jul 2026 23:38:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783381115; cv=none; b=lFLvCvq8atmREOJqTQbOZqTQMoRSc1v4wJOU2YYYWeh52hW2j3FxTSVSJa4nAjD53YK6eDJMD817RV8n/QVG7yHhhT6B/YrLIYV5s2xHa8a5GLgZdXKgsRH79qK8clHaSECI+z+hjkm37aWeFxUmY4jEFs33yBzwFWokP80LXak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783381115; c=relaxed/simple; bh=omVKW0FzuuzdyNNmEiYyWSj5RkFvvlq3j+IUAbrUW5Y=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=hJKTj6cicE6GGVA9B9rsizZlc/oLi4RyCQS08q/a+iYS4egugU6ZshOoniuOqAgSgBqNE00YSj7jsjM4tqufnsLC203dCP0PwtevahSnZw6YbtdZcx8MPlmWvy9TJHL1N9J2J3ssCoQnathRrrxSrHR0KyAilCyFSZZJ/9OVzZo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=T70ApH+i; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="T70ApH+i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AAAD1F000E9; Mon, 6 Jul 2026 23:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783381114; bh=4RvaHHR1JLiGd+lSbTeUq745Smy4dv+Izz0JZQMDa24=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=T70ApH+ir5I5cPXv98r8DrjVUoxum7BeJzgWMoS2eW2HYvEJdSbuahFtwlVhniqwG cRkLwfmlrUNps+9jh/GiNNWgNuzbOA/UWGihVUfo9zJUyGvpCSAo8OL1ufFhWfuF9N V3Tt5MLXSBBO3mq49vKsQ35HAxcJ718rQVOQEG1A= Date: Mon, 6 Jul 2026 16:38:33 -0700 From: Andrew Morton To: Richard Chang Cc: Kairui Song , Qi Zheng , Shakeel Butt , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Michal Hocko , Lorenzo Stoakes , Suren Baghdasaryan , "T . J . Mercier" , Martin Liu , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: vmscan: abort proactive reclaim early when freezing Message-Id: <20260706163833.19b6c869407d51ba8e278f56@linux-foundation.org> In-Reply-To: <20260706081218.3438762-1-richardycc@google.com> References: <20260706081218.3438762-1-richardycc@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Mon, 6 Jul 2026 08:12:18 +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. > > This check is limited to proactive reclaim (sc->proactive) to avoid > affecting reactive reclaim paths, and wrapped in unlikely() as it is a > slow path. There are a number of ways of getting into proactive reclaim. Have you checked that all of them appropriately check and handle signal_pending()? AI review thinks that classic LRU might need the same fix: https://sashiko.dev/#/patchset/20260706081218.3438762-1-richardycc@google.com