From mboxrd@z Thu Jan 1 00:00:00 1970 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 401A9C433EF for ; Thu, 28 Apr 2022 10:57:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BCB2D6B0071; Thu, 28 Apr 2022 06:57:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B82846B0072; Thu, 28 Apr 2022 06:57:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A67DF6B0073; Thu, 28 Apr 2022 06:57:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 94C7F6B0071 for ; Thu, 28 Apr 2022 06:57:45 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6470021F16 for ; Thu, 28 Apr 2022 10:57:45 +0000 (UTC) X-FDA: 79405987290.26.2F351F7 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf27.hostedemail.com (Postfix) with ESMTP id E0A154005D for ; Thu, 28 Apr 2022 10:57:42 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kpsxm6d1Pz1JBKf; Thu, 28 Apr 2022 18:56:44 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Apr 2022 18:57:39 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm/vmscan: use helper folio_is_file_lru() Date: Thu, 28 Apr 2022 18:58:02 +0800 Message-ID: <20220428105802.21389-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E0A154005D Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Stat-Signature: 3pzgmhnng88rxrhwwu5earukkaoxqwyh X-HE-Tag: 1651143462-495308 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: Use helper folio_is_file_lru() to check whether folio is file lru. Minor readability improvement. Signed-off-by: Miaohe Lin --- Hi Andrew, Please feel free to squash this into below patch: https://lore.kernel.org/all/20220425111232.23182-7-linmiaohe@huawei.com/T/#u Thanks! --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index ecd74858b8d7..9ff3cc2a941a 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1414,7 +1414,7 @@ static enum page_references folio_check_references(struct folio *folio, /* * Activate file-backed executable folios after first usage. */ - if ((vm_flags & VM_EXEC) && !folio_test_swapbacked(folio)) + if ((vm_flags & VM_EXEC) && folio_is_file_lru(folio)) return PAGEREF_ACTIVATE; return PAGEREF_KEEP; -- 2.23.0