From patchwork Tue Mar 29 13:26:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12794846 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 52D73C433EF for ; Tue, 29 Mar 2022 13:26:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFD488D000B; Tue, 29 Mar 2022 09:25:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E36508D0009; Tue, 29 Mar 2022 09:25:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD9CB8D000B; Tue, 29 Mar 2022 09:25:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id A9D388D0009 for ; Tue, 29 Mar 2022 09:25:53 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 63F3818259C4C for ; Tue, 29 Mar 2022 13:25:53 +0000 (UTC) X-FDA: 79297496586.23.0CBA7DD Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf03.hostedemail.com (Postfix) with ESMTP id 9ABDD20019 for ; Tue, 29 Mar 2022 13:25:52 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KSVd02dXYzCr7Q; Tue, 29 Mar 2022 21:23:32 +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.2308.21; Tue, 29 Mar 2022 21:25:44 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH 1/8] mm/vmscan: remove redundant folio_test_swapbacked check when folio is file lru Date: Tue, 29 Mar 2022 21:26:12 +0800 Message-ID: <20220329132619.18689-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220329132619.18689-1-linmiaohe@huawei.com> References: <20220329132619.18689-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: nxeiy99ocwhccw79sj7sephpr8zrkn5i Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Queue-Id: 9ABDD20019 X-HE-Tag: 1648560352-892775 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: When folio is file lru, folio_test_swapbacked is guaranteed to be true. So it's unnecessary to check it here again. No functional change intended. Signed-off-by: Miaohe Lin --- mm/vmscan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 1678802e03e7..7c1a9713bfc9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1434,8 +1434,7 @@ static void folio_check_dirty_writeback(struct folio *folio, * Anonymous pages are not handled by flushers and must be written * from reclaim context. Do not stall reclaim based on them */ - if (!folio_is_file_lru(folio) || - (folio_test_anon(folio) && !folio_test_swapbacked(folio))) { + if (!folio_is_file_lru(folio) || folio_test_anon(folio)) { *dirty = false; *writeback = false; return;