From patchwork Tue Mar 29 13:26:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12794841 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 68A99C433FE for ; Tue, 29 Mar 2022 13:25:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 166758D0006; Tue, 29 Mar 2022 09:25:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1174D8D0008; Tue, 29 Mar 2022 09:25:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED25C8D0006; Tue, 29 Mar 2022 09:25:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id D2E4F8D0002 for ; Tue, 29 Mar 2022 09:25:50 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4F02BA4DAB for ; Tue, 29 Mar 2022 13:25:50 +0000 (UTC) X-FDA: 79297496460.27.FDBA6CD Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf11.hostedemail.com (Postfix) with ESMTP id 4F8A040021 for ; Tue, 29 Mar 2022 13:25:48 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KSVdf5wZszgY8f; Tue, 29 Mar 2022 21:24:06 +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 2/8] mm/vmscan: remove unneeded can_split_huge_page check Date: Tue, 29 Mar 2022 21:26:13 +0800 Message-ID: <20220329132619.18689-3-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: rspam04 X-Rspamd-Queue-Id: 4F8A040021 X-Stat-Signature: artaeunwdm7n8n1693jgefedtk6hi14c Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-HE-Tag: 1648560348-780617 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: can_split_huge_page is introduced via commit b8f593cd0896 ("mm, THP, swap: check whether THP can be split firstly") to avoid deleting the THP from the swap cache and freeing the swap cluster when the THP cannot be split. But since commit bd4c82c22c36 ("mm, THP, swap: delay splitting THP after swapped out"), splitting THP is delayed until THP is swapped out. There's no need to delete the THP from the swap cache and free the swap cluster anymore. Thus we can remove this unneeded can_split_huge_page check now to simplify the code logic. Signed-off-by: Miaohe Lin --- mm/vmscan.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7c1a9713bfc9..09b452c4d256 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1691,9 +1691,6 @@ static unsigned int shrink_page_list(struct list_head *page_list, if (folio_maybe_dma_pinned(folio)) goto keep_locked; if (PageTransHuge(page)) { - /* cannot split THP, skip it */ - if (!can_split_folio(folio, NULL)) - goto activate_locked; /* * Split pages without a PMD map right * away. Chances are some or all of the