From patchwork Wed Jun 28 01:49:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13295132 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 9A004EB64D9 for ; Wed, 28 Jun 2023 01:50:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 157048D0002; Tue, 27 Jun 2023 21:50:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 107958D0001; Tue, 27 Jun 2023 21:50:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F11408D0002; Tue, 27 Jun 2023 21:50:23 -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 E32AA8D0001 for ; Tue, 27 Jun 2023 21:50:23 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C340BB043E for ; Wed, 28 Jun 2023 01:50:23 +0000 (UTC) X-FDA: 80950476726.28.0FB9D03 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf28.hostedemail.com (Postfix) with ESMTP id 7FB98C0014 for ; Wed, 28 Jun 2023 01:50:21 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 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=1687917022; 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=0vFlJfX/d8pMFvnjJOUGNMFQFyTbAnyocH2dgytbhoI=; b=LwE00WN0sGmeNMrBX9e6eJJxOHId+OU47uoB08Ln8GFo/b1bFHp9FAnQpcmpP0kNquVWNh qDEmfPQl+qw6WFDQUfGEauvRsK6C06PNC/aTumvTm2yoUBSFdwJkKWNnQtKfuX6rzEPLJ5 CoOz7FqRKRttW7grB/P5HhabNPC/ctY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687917022; a=rsa-sha256; cv=none; b=C5O0TCNvJTceXn9rDW0Zub2XBnErMUeyYfvz+Gq/Z0PXK4mdo+u9QEiIPcmIe3TV9bW1uG 5u5SKIk2xv9yLmunyurKx5hx0T3sP3szi4hWpo9M+IKJwG96K3hDfo8hMgUe49kTXO+2Wt paahRX7WEIY5ukw5VUcBfTsycGyf1Yw= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QrPcC2653zLmgr; Wed, 28 Jun 2023 09:48:11 +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; Wed, 28 Jun 2023 09:50:15 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH v2] mm: memory-failure: remove unneeded page state check in shake_page() Date: Wed, 28 Jun 2023 09:49:29 +0800 Message-ID: <20230628014929.3441386-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: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Stat-Signature: hfs6dy5moadbqiqsimq6hk5koh4aoocd X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 7FB98C0014 X-Rspam-User: X-HE-Tag: 1687917021-478250 X-HE-Meta: U2FsdGVkX18pKrhriJVs5li2NgE0Bxn3ZZmvtfTiehoCnsakpgRBmeAdL4SyybYpMiFZluAS/UfXf83N54h/B4+wO7JtiQ80viGXlkpXcWHQzbKUwi1n/Tdpcmq+YOKmHcUeGPm7BvGPGI/JiSOm1pNU32VA/kpDpFOVGI85aWkEVOwHYOc6bqTNFdJWCoZfd6SL6fi5AwOe4pl8f9JDsHWdnvb+Bc8PGFtxl/9IPbzh3HYm68UdCCBc4NhyNIxta58t0G96pZWzC5sqSYQhSaCJU499SQV0CegFjoBYNmCdZ0IqTCb+YOsCDgnaZXfwjLQI6CfTw34ae2fZmqwPhuZlgQjbtA6WXQ1f63y13Vw+/JZjDIFFgn0bRQ1CrZRdQVkwkaVSdqEXICwi10a1FBoEK1cg6YP2nkh3PR7Zv9JSUTCLyWk4zsE/YxCAfk4vHSuz9+DUG151rsxUt3Erwc3mAWhdkV3ZUSaecr29OPuJuBMamWSSLhWW0MR64QIarUWON9z9J1WxCCYmpYWApoNTvjI5hFglPE2qXC29HHxtAXMzZZR61IHDW5P/WCinp1Leaf9x9i5N339XnMNNQJuA5pJUuy+nAJsmLQDLUhGNOnOjsBIP7mtApwLJbAc1xbbZqCYqFEPQ5/k5L8RY1LxjBbE/SovOLRXZ97GPxAph+6c89cqsRPmsKp1kl2w/yNPXTNumxWhDJXJILyVQZruidOPuNdWuWiVx1owtBlq0Sa8UDfKv7IX/01gQdPDJSpqLagNT2RenPd6V95X7i1TcJjE2heXNmMGDTO2Lb6ae7lnLV+/px9HsTXcjsudl5EkYoB3efKLTTQ10pvr0nSORe7GxrH/l21tp2JXCcaOE36HW2miJaSWXgAm0axaNmWNVlslcZq9dbx3IxNUN783++XeklG7OZ3LQBEsF5y9fsaw/1kId7uVm3pzFpyv2kU7zdAjRlOpdvlIl+gs +f1je6at yGUYBWPS6kaArr1n/DsQtur8Ly0hR7q9WSBWhiPo+QQTT1SSJRuh4nUDRgbRjhPO+3+b7WEsG+nMDUhLEoQawYdu4AxL8l1AC2UrpDlXo7uJcAKzjZCHEjZyFznVU8wtaONgrayzw3pIeM5gMQcEIr3EA7LXiMoznahmSrS4zxftZLeztzZKG/S2gp/IxftVLVGZyML5lsM57t4dd1PhqyiYsBg== 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 --- v2: put TODO comment together with "if (PageSlab)" block per Naoya collect Acked-by tag per Naoya --- mm/memory-failure.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 5b663eca1f29..66e7b3ceaf2d 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -372,17 +372,14 @@ 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; - } - /* * TODO: Could shrink slab caches here if a lightweight range-based * shrinker will be available. */ + if (PageSlab(p)) + return; + + lru_add_drain_all(); } EXPORT_SYMBOL_GPL(shake_page);