From patchwork Sun Jun 25 11:34:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13291888 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 61936EB64DC for ; Sun, 25 Jun 2023 11:35:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8595E6B0071; Sun, 25 Jun 2023 07:35:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E25F6B0072; Sun, 25 Jun 2023 07:35:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6837E6B0074; Sun, 25 Jun 2023 07:35:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 556E26B0071 for ; Sun, 25 Jun 2023 07:35:20 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 1E9E41A0EAA for ; Sun, 25 Jun 2023 11:35:20 +0000 (UTC) X-FDA: 80941064400.15.B299883 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf02.hostedemail.com (Postfix) with ESMTP id A0C1780007 for ; Sun, 25 Jun 2023 11:35:17 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687692918; a=rsa-sha256; cv=none; b=gMkDrqh0+30HuO86qdOWhjGqpvZCz1qmXtf80/EvXCD2rIirbR3wgbBhj24ohm+28JfvU3 IIuvXovdL2Qd/b7Pqz+7omu8gH9WpVZ5p5P7JhPRD8t87llEEYZbBpxFCcBzqJaZooeXf1 eN42wbzO4TWzW8YIe+CZh2eN7IGZxZY= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687692918; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=tOC++tU4W4STc1R30H22nsbSI+PtW50raUlbzJSHYV0=; b=lLiFIa6HWHmQ42mxryIg3UKKVX0m8lKfdoiNW3abwMFSWjNtug4H0rXstkxrKDiA4DTAyz HeTnS3LShk0lxf1djbyI3dj4mgUTASiI/QvwElrilrV6goelp+4ZLk5nZYoKdsEhut8sQH Y4ZAp9V2ycN4R1ui3E5LKJmVgaD+t24= Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Qppmg6DLJz1HC9K; Sun, 25 Jun 2023 19:34:59 +0800 (CST) Received: from huawei.com (10.175.104.170) 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.2507.27; Sun, 25 Jun 2023 19:35:11 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH] mm: memory-failure: remove unneeded page state check in shake_page() Date: Sun, 25 Jun 2023 19:34:30 +0800 Message-ID: <20230625113430.2310385-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] 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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A0C1780007 X-Stat-Signature: pp8zx9tujk3e1nsdpbhnqm51p694jfkr X-HE-Tag: 1687692917-242817 X-HE-Meta: U2FsdGVkX1/JawE3tRpccorqI11B4l4Au++Df5mrs8orxDPTEbjRZp6pCiprVNrh2QEf9sTAQPELAyCxu6GhSR7IOA7aWN0zW0OrBmNxuYc3Z2TtwKYNYjQ0OA1r6jgxdOPcDjd+UVmm8FuTwEtcOHDQspJ/0UKKXIi0o1uRt0ByhAl2Ax/VNrlK2LErglLn1Si8YqiRTFRr6g5zXKkPcg14kziMleQp8sOx3nl3J3ln753uMzu+DOyhxyYLazOIfdO4dIef4I/tCl3iXTGiWtS3S46qQHGfsz2Lb6/k8yxWz5ZMMShwoPOotPOPRopU3q5dflSmoBOaeczZmv0XibzbZHc7QBvZ0J4cpgUOfYm4ottsvZDzrswq5LedIQrrASA9DNDPXOlqIO1I8MrjVt4WfDRCUYGSTZLAXHvIIRSgg1cr236M7PyYNG34ZojnHsmkypb2ZWo9ACJRv2q+fQKO1ZXDlr5UKDFBwi+ua3SehGARCUHubN2gvaI95c1q1/HX+7aY88OioUnanm54TG1ICHf74xfP3HKCzXWuB7SsOW11lbdnkNL/tOgggvN19GBISYrGRd6brosFNf9F1r/izO8FHSISi4rEiWfe6g/K68xg5ycnVXLuaz9UUrGNRSgClmC0zvJoo9tt4TGygIbkyF9UYUjzJXPW5tnq921GTL1yLZhtzAlqirEmfiNR52auFS7C8QM1HE/GC/EqyYG6SrPY0pHfoO05YrAMTbepmvmskChTt2NYHA1CBbNr34aBJKHGjBZvpuDa0SNTPQ+TN1QzYyOFbN4MtL4e/lLXg++YavPJl0ie3d5W2+V6aaRYhvKdU2xBfX8ZkTkRChqJ6gQpMvi2dKMAGTo/Vz4L9N7mxYgeAXGV4v0CODO0dHQTe9d3OynkTMRfPauO+x5TjyrjxAwcK6bOfXZSfSDwN/Rd2zN58PfngAsuFy1r3KbQ+qKxcO9l8teys7r wnS3iy4c gFoSB6o++7PXm/hw0TSwIEWwRz3mykrZQJdGOhhEaNwDD1l9umrrEwjz8A6VmgAfbKVu4pyEHidekDaJfoDz+8rUZ4bmghr5jvXBlZZj9oaaZrHurC1DxiWyClLxZhSaTrA6Y/Q+Q6suam/DT+S6BI7vdzOAVflloFbpFkWAGkuAmfuaqESbeMFGiEOJYgJOyahvn 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: Remove unneeded PageLRU(p) and is_free_buddy_page(p) check as slab caches are not shrunk now. This check can be added back when a lightweight range based shrinker is available. Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi --- mm/memory-failure.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 5b663eca1f29..92f951df3e87 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -373,11 +373,10 @@ void shake_page(struct page *p) if (PageHuge(p)) return; - if (!PageSlab(p)) { - lru_add_drain_all(); - if (PageLRU(p) || is_free_buddy_page(p)) - return; - } + if (PageSlab(p)) + return; + + lru_add_drain_all(); /* * TODO: Could shrink slab caches here if a lightweight range-based