From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96B9D4446E8 for ; Tue, 14 Jul 2026 12:23:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031837; cv=none; b=BFT533TChG8rdp8CfKuiMjE+0PtqQx2OEg9Bu4NPqkqrL8ou/UXobR91lQnBiX43RgAYW9g/7ojthK8cr65uMNG3pXzuG+x3yF7nCHfzo0ozdS6s5zj2F/GaMNNWrNXwGEZh4kvaEA66Xbr97vmUfs5gYBN3G4zSYc3I9LLsXyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031837; c=relaxed/simple; bh=stHZ0qd1ej6FpeEs/MOs8onI/Meey1VfUeLuij3ZHeY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YOFFt0gv63TOBnAEmlydoQ5Hs/YuQo1vCgWSnCaeBdFWNKGE8Plj9K73zdazFiPvyaYltbZLQvsZaCrZDDWY+vwmBfaaSD2eKabu9qElU7U3kYITS2nYItfxFQyYSv2R6p7iUyW2SuEfT1TjrivmU0HqTq2r/AhvNtv8fs6aa4c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=fa0eMMHk; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="fa0eMMHk" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-493f4638f4aso7957125e9.3 for ; Tue, 14 Jul 2026 05:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1784031830; x=1784636630; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=cOGQ3I7Kzejlffc7S9mPx4ZKKD0nbZggYmC8L5xWC1U=; b=fa0eMMHk0bXfakvFlmpY2qgQsDcmqA6GL3kQJcw4HGLU7Mvo9dy84chA39Osp0k2nU lRWPQkQTQGiz85cXy9+JlVD7hAeIFDO9cwis3bJ6/WX55aZIu1rOhspntesuVIEzv4vy yiBtl2dp7q0mpEB9YEQrjZNJ0Pgp6ElMFQgaNGyWxIh81iBTzdDX2nB7BScymWauorGe 4G5dmlFgpjlxKAg8P2bW4bJPESzIfAt5T3g1mQh6N0gJAAZ8VDCuP3Fy3jlDiCKtqRFL m5r5H3f66E0yc5cqEIQ1vWGarL290e7FGi3JlG+99h1EsIu7WnboV4ehZtWX5xTvW/K3 Tzwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784031830; x=1784636630; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=cOGQ3I7Kzejlffc7S9mPx4ZKKD0nbZggYmC8L5xWC1U=; b=lFPW1zUNQzcXlvf2iDZOJMd/bddYSsi1l5nNBTRwU38sGd590owRyVMfZ3MAqOWWkV 9hBOMh0QpbC26nU8v0QBLeqROcwrHg5H5xlH0Wceyv3/ivMqoyOQtEYBdr+jLlHEavGJ TGiZkrVKWTBM71bjNlu1aK5zrqdIg94ky8FU9eToQxddHiqABEN+zf0ajwcBdpcU5USE rD9FOQMjX0X1caNo9/BZTMjWGuAeRQ5KrbxQPW8ExLCiRN0V6GBnWAuuAdEHJG+dBCbI y1wo5lzek76PYOnFyrRQsFQKVh2KuhuxZuxCumV705/cWA3C0aoYyuz7t1hI+4XI9iUK Xokw== X-Forwarded-Encrypted: i=1; AHgh+RoGVJm2nzJMDHtdK8xrZNUBePhM1PXmYjoyAHrWogKmGIvdlQcRcekzQaRjIEOxOL1eREmumyF8l35FgOA=@vger.kernel.org X-Gm-Message-State: AOJu0YwOTZeBic/OqHmNMiIvWgBujKqqsBzbk/88Xs9vyF2n53V4QDZe HBmMAXtucO0tzR5T9FY4uKzmK2+QClZwO5Zza9d66LiBCLslLpNl1bmce0C23SGtrLU= X-Gm-Gg: AfdE7ckP0ONJRhVSgNe5150MdTZEfe9RmAuKiGm8IrRl2I2OJtrAQNlTYq9YcLEuFgd DsX4UJwu6nFAiE2+WY4W19dhtsvz7iGQUnbLnB/wmM8oHRdiwkTjfioiuuNVd9fiwRCYzYQiDCM P7RpJcHqVkyDKiWM4uu20QAnZBEth3Le+kQgCFj0aTZ6aUrHksHHp9c2NbCgjQOzsTQGIM7gp67 Qn31OGYoemH4ih1ZEY0jHMj4mMu8YVoa4N72FSFNnMVV1c3GxB21GdtLYFDPz2AVk7KSj+wJxmS xbHAwwVVr/f0BPO++08eTPxb0b50eqEwznsLSp4kvszc/yIF/T5uIf9kLlg/YwGIs/8hTapfP+W 1aESng5G/4H+wG+N+dvPL+IP5tqlG8Fyy+ssN0AE/RgNzvpoT5/xaD7NFHnt/TddX43xhLPXMUt FGENmCK7LrEIWbCySjtpYX/sONqw== X-Received: by 2002:a05:600c:4ed4:b0:493:c42e:5be0 with SMTP id 5b1f17b1804b1-493f877e3demr150320655e9.0.1784031829843; Tue, 14 Jul 2026 05:23:49 -0700 (PDT) Received: from localhost (109-81-95-153.rct.o2.cz. [109.81.95.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d97527sm390390775e9.2.2026.07.14.05.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 05:23:49 -0700 (PDT) Date: Tue, 14 Jul 2026 14:23:48 +0200 From: Michal Hocko To: Richard Chang Cc: Andrew Morton , Kairui Song , Qi Zheng , Shakeel Butt , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Lorenzo Stoakes , Suren Baghdasaryan , "T . J . Mercier" , Martin Liu , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: vmscan: abort proactive reclaim early when freezing for suspend Message-ID: References: <20260709072231.3163082-1-richardycc@google.com> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue 14-07-26 17:00:37, Richard Chang wrote: > Hi Michal, > > On Fri, Jul 10, 2026 at 2:27 PM Michal Hocko wrote: > > > > I believe this is a wrong behavior. Freezer should be invisible from the > > userspace POV. Your patch makes the pre-existing problem much more > > visible. I believe we need a slightly different approach. Should we > > try_to_freeze in well defined places in the reclaim and turn > > user_proactive_reclaim to fatal_signal_pending? > > > > I believe your perspective is that we should avoid -EINTR during > suspend by transparently pausing and resuming the task rather than > aborting the system call. Correct. > However, this approach faces a few constraints: > 1. fatal_signal_pending() only addresses SIGKILL, leaving us to still > handle standard non-fatal signals, such as SIGINT/Ctrl+C, for > userspace callers. fatal_signal_pending takes care of all fatal signals - i.e. when tasks doesn't really return to userspace because it dies along the way so it doesn't realize there was a kernel internal signal ever triggered. > 2. Calling try_to_freeze() deep within the reclaim path is complex, as > it may hold various locks (such as RCU, page, or cgroup locks) while > suspended. True the placement would need to be done very carefully. > 3. Since -EINTR is already the established return behavior in > user_proactive_reclaim() when interrupted by signal_pending(), robust > userspace callers should already be equipped to handle this early > return. This is relatively new code and a broken one I would say. > On the other hand, the freezer timeout/suspend failure is a genuine > bug currently impacting Android devices in the field. The proposed > patch safely addresses this immediate issue by leveraging the > pre-existing -EINTR exit path in user_proactive_reclaim(). Could we > focus on the current patch and open a separate discussion for a more > ideal, long-term design regarding freezer invisibility as a follow-up? I am not insisting both to be addressed in the same patch. But building more on top of a broken behavior is not healthy either. In the current state this should be as easy as turning signal_pending into fatal_signal_pending and try_to_freeze at the pro-active reclaim entry point which should be safe from the freezer POV. -- Michal Hocko SUSE Labs