From patchwork Thu Feb 8 06:18:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 13549348 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EA84C48260 for ; Thu, 8 Feb 2024 06:18:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08DD56B0092; Thu, 8 Feb 2024 01:18:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 03D8A6B0093; Thu, 8 Feb 2024 01:18:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6E746B0095; Thu, 8 Feb 2024 01:18:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D82EF6B0092 for ; Thu, 8 Feb 2024 01:18:44 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B81DAA248F for ; Thu, 8 Feb 2024 06:18:44 +0000 (UTC) X-FDA: 81767632968.12.B06E8EE Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by imf29.hostedemail.com (Postfix) with ESMTP id 38D70120002 for ; Thu, 8 Feb 2024 06:18:41 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707373123; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=h8k0LVJhT/AtzswsIjpIerLLyRxbwWIQLpCIIUwzTPg=; b=G3ZynnRflBIufYZ7eJR4uXEPwNsxLefK3dWw9zK0JSerEeSL1AZMQPutNX0aiT6Tg8hov4 FjzE/ittnsHvYZ3KeMEnNWgNyJta9vyaQ1wlHdFvbjtO+Kp4mGlzeHe5c84UWfkDyHndSk BGqtsSs/h3q+VwKRoXS1UybNxTcuhvs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707373123; a=rsa-sha256; cv=none; b=lxh44PG8dQKz1+fQDC7/5hmfyarKCxpSp2ZNw0wHdguT1L+/op3A74aHjUyohuO2nz1Zc9 G/bSsQ6HpbXfYN92lGXUvlWRsK1QCf4WQwYDHIpN3aTwn9YwYu028UxlKLK9fgZDodEBWb d/GvkHYd/0HttivQLukn6/Z12VAceOU= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com; dmarc=none X-AuditID: a67dfc5b-d85ff70000001748-2b-65c4723b6356 From: Byungchul Park To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com Subject: [PATCH] mm, vmscan: Don't turn on cache_trim_mode at the highest scan priority Date: Thu, 8 Feb 2024 15:18:25 +0900 Message-Id: <20240208061825.36640-1-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFJMWRmVeSWpSXmKPExsXC9ZZnka5N0ZFUg1UfJCzmrF/DZnF51xw2 i3tr/rM6MHts+jSJ3ePEjN8sHp83yQUwR3HZpKTmZJalFunbJXBlHJu8jr3gCkfFod4zTA2M vexdjJwcEgImEjOm9MHZ6+eeZwWx2QTUJW7c+MkMYosIyEpM/XueBcRmFgiUWH5oDVhcWCBc Ysm9T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IFUfv2JJ2PaxvXHfh6fELsOy6Ba7sEBJ6ov8fvvA+Er/OFIRitMzJGCUC8Nwo0j 6L8RYMyf saLAZLVA/4G3hVjVTk/qwiL5Zh+BFAvHuRY/0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: With cache_trim_mode on, reclaim logic doesn't bother reclaiming anon pages. However, it should be more careful to turn on the mode because it's going to prevent anon pages from reclaimed even if there are huge ammount of anon pages that are very cold so should be reclaimed. Even worse, that can lead kswapd_failures to be MAX_RECLAIM_RETRIES and stop until direct reclaim eventually works to resume kswapd. Signed-off-by: Byungchul Park --- mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index bba207f41b14..25b55fdc0d41 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2268,7 +2268,8 @@ static void prepare_scan_control(pg_data_t *pgdat, struct scan_control *sc) * anonymous pages. */ file = lruvec_page_state(target_lruvec, NR_INACTIVE_FILE); - if (file >> sc->priority && !(sc->may_deactivate & DEACTIVATE_FILE)) + if (sc->priority != 1 && file >> sc->priority && + !(sc->may_deactivate & DEACTIVATE_FILE)) sc->cache_trim_mode = 1; else sc->cache_trim_mode = 0;