Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp77408rdb; Wed, 7 Feb 2024 22:18:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV9hk4hERlllvjJlWQn3oTP8BbmcxKAOeuKks4dTaCibKUnZEKFzWYIsmMHlNAR2otQrse/PzNmzYU2RT0o61bqWAxfbg8w99rTdukooA== X-Google-Smtp-Source: AGHT+IH0JTdg54CxmFK/uBCgMQBshnpcFWmp/ECTGlVT/33oLl03P15erx/r8yZ3YlhhjSLSla4K X-Received: by 2002:a17:906:3e09:b0:a37:bd9c:ad74 with SMTP id k9-20020a1709063e0900b00a37bd9cad74mr5149979eji.75.1707373137538; Wed, 07 Feb 2024 22:18:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707373137; cv=pass; d=google.com; s=arc-20160816; b=V1NJEw7f1WhuPZm9/uhs6zffpHF0BtPUs0zNgnQXrAlnrFlD/bZ2N+G4b7qippfkmq gYm7K8oEnMZEgOn8BMTWYb/hMWtXtkq7D1KMC3UcKOzhY+w3AC+kdGwEIj645Cszkbw+ ngUoj/ZT4BezbGdIBqahLFshFvXX8iVpP3uuj44S+jTWyBckalPOwxQ/yQZQeJ23OJgY HTW3CttSUoNGTI8XC1b3cvqaKAh2HeXwbMCLJxoEDn6kBy40uNKMefYKgojq0FKJQvpW oOZDH7+PRXgXduZmmzCkHBjz6r438MZllh/oB3V77uzu/4lK7v50LsDxFIXwJMmOnde3 4nWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=h8k0LVJhT/AtzswsIjpIerLLyRxbwWIQLpCIIUwzTPg=; fh=vbNtq0IbODJFjO5Go6CzzAoexNZ2LqLvRXvQucWszIY=; b=jEte4Fpil2g8fJBqe0KzkNDjyFngmggQ0YKD5oRVal+AA/fwGi41n9uviJEL2bi69v Pbj7hIcTcU4+wJ0ZK4xbZSIP8ZmoqHbU+QCFWmpPtOj3tx+H8XdcIEIMEc/fxK0e+YFn VlcXF3lnKLHEr+LCBK7SAF3frtJctg5i7h0IbVkqF90uNP/XLfMZx0LcfxD+YB0etn81 U+GmpsnRXZm9TMk+f2FLYn8F3Huf+aPYkszfX/olChc2lv7YPc9hJ24iWOY+bevoe/kw tQDXS7przWLzvZ+NhBLXYopvdn6KK6fgzx3VPJwPNsNNjUd2WkehNzUBOwV1ykktmCVl 4WiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-57503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57503-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUbjqri1eWbzn9t3Qd+wjCuzmAK6Pr3MTw3etzkN0RlTBtSYlhUzyWHQCyWhKSGsmP6YUJz/wDAL/lqXdnsirjKVNe+nUcjFK83e6Jagg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k7-20020a17090646c700b00a38461f6447si1833657ejs.507.2024.02.07.22.18.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 22:18:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-57503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57503-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4731E1F23CC4 for ; Thu, 8 Feb 2024 06:18:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E63367E61; Thu, 8 Feb 2024 06:18:50 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEF7D67C70 for ; Thu, 8 Feb 2024 06:18:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707373129; cv=none; b=DYa6ivFnb19gySzfmFwyyiooe1p28kWyKoN84qgf46wihTgrvp0BpCtYD8JKq9uUpJN6NfXOAfbqdVVvB9gnThJitt+Dz2myZAeePeQBjHx44rSYpIG1KI3fidIWP8pVqFLEOjOKNDcfiTlreevirPdqM3+lbLdlhWoyyCzM3Go= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707373129; c=relaxed/simple; bh=jrWzJay/sTsuzrPvK8L2TqysXsAVN52IkjoORxSCyoc=; h=From:To:Cc:Subject:Date:Message-Id; b=C+u7d8nvzz+xzGqzEmccynIHnwzH4Gev4JRDNGQJzfZZdIoJnu7kTFX+6dR8HWLfMmFtnIsDL32Mw8endgCsQd95GhMU6mDo7xQpdpxYOxwnppGLCpW+iww//oBXudfdWGvsyMtzMw/NakZFPVCSeCVLdP3aw/VnH34cMRpHGHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com 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 Ysm9TkYQm0VAVeLB0+Ngc3gFTCWu/v7MCjFTXmL1hgNA9VxA9jpWiQffT7FAJCQlDq64wTKB kXsBI8MqRqHMvLLcxMwcE72MyrzMCr3k/NxNjEAfL6v9E72D8dOF4EOMAhyMSjy8J8oPpwqx JpYVV+YeYpTgYFYS4TXbcSBViDclsbIqtSg/vqg0J7X4EKM0B4uSOK/Rt/IUIYH0xJLU7NTU gtQimCwTB6dUA6ON5jHj7zvaa002/furxs4g9rbkQf+cmC+JpfENlXLTXD/82N36YGJJZ/Oa eSsfVh7vivDMCJjEIMn1rWFlX8yPpikngtJt+TTOKMhanz7OUrlH8sUvHe0XaS+5u5dfTD6f p5Gmr58Qk+qhZTDT1iBFSPra5kU7765o/al/kX9O9BeZbg1eEyWW4oxEQy3mouJEAIWV+Ert AQAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIJMWRmVeSWpSXmKPExsXC5WfdrGtddCTVYM05OYs569ewWRyee5LV 4vKuOWwW99b8Z3Vg8dj0aRK7x4kZv1k8Fr/4wOTxeZNcAEsUl01Kak5mWWqRvl0CV8axyevY C65wVBzqPcPUwNjL3sXIySEhYCKxfu55VhCbTUBd4saNn8wgtoiArMTUv+dZQGxmgUCJ5YfW gMWFBcIlltzrZASxWQRUJR48PQ42h1fAVOLq78+sEDPlJVZvOMA8gZFjASPDKkaRzLyy3MTM HFO94uyMyrzMCr3k/NxNjECPLav9M3EH45fL7ocYBTgYlXh4T5QfThViTSwrrsw9xCjBwawk wmu240CqEG9KYmVValF+fFFpTmrxIUZpDhYlcV6v8NQEIYH0xJLU7NTUgtQimCwTB6dUA6PF 05Ip4pI/TQUn5RtKPZt3KYdnUirbYhurZNYkxw+3XvbV5ske+K15iedigu/M6qKUtC+xO4x2 PpNeVO4lqDyj9/yGZ3qnu8Xfnd1zLvDhqZOVi1ZImWawKV9WEcuUKIgylsm4lb+CLzwk7UVA bekXiZsb5xyRjHO9bbH0aPLZZ0/POMQ/jFViKc5INNRiLipOBAC6SBcS1AEAAA== X-CFilter-Loop: Reflected Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.17.1