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: 112561 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6867435vqr; Sun, 25 Jun 2023 04:44:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tIQ4JEXRPNxuWva0B+f6Ly00GhcMXSNt/BiDOB7yt3Au8T5LbrH9SbVzuhhWClhewNsC0 X-Received: by 2002:a9d:7a41:0:b0:6b7:431c:15f3 with SMTP id z1-20020a9d7a41000000b006b7431c15f3mr948831otm.28.1687693490340; Sun, 25 Jun 2023 04:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687693490; cv=none; d=google.com; s=arc-20160816; b=qQb/WImQRbM/p2y68MG7QJMwz6ZUfSlbbA8oMZXWrFobBMDIKqBFcfA/vnWvlhppae pyYe+NwawhSEHGWuqefnJ2sL+2qpJc69ruLt77Hy7MG2KYSbMnk5+QKPi9ZyXTuuUsy3 lz+Md544Srt2S67z3RC7Lz7DpA1E9Ldz3CNvANC44g8rrF6bO4goKNzhI6VmXKBqq6mr uMd9peDAvjpWhw+1h5FW7riCSIfeVAYOP96MaUVLqXqlr9WI/mmC27X4lGP2PIwDu+QO IOxQzGnZ540gDMHMN5NrBakx6vJ7OhG/zYt9SEJ7FquTE9ZAkdEx2p7/KHU/B+/sz1RF 1AOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tOC++tU4W4STc1R30H22nsbSI+PtW50raUlbzJSHYV0=; fh=kP0L7jzW604qIlwIWwCV4xHGxfeYL9qfthvX96QEubA=; b=UWYL5nXRx2OwsG5BYjFTBhC5NkLME4/TdWQCuh0vksADZLotI3nf+/fvPTbz1K4RYm TKi0NtCNFzkiJMln7XqEpROH7cxcnIm0TnTUms68fPDr4ZtXDXmNlZfN32k6xQnx/OoU Lu+pAsXkdfOtB4pn/Lkue75cL1sv0Pcsc+yz7uzlE+9rngNE324OG6MQknipyID5JAM7 IuraotL8i2+BwgUwq/jNiGOZ68j/lqBOu5WnCu1Mqz5MXhMj6I8fiKZnFN30MzmCDhG+ fQGbubQuKCSFpMUDavEm8FicIxjYztJjCWqDlDZH0qiNyagHS/dYTaEtlL3kYbfAlvLG kAlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u34-20020a634722000000b0051b9ce24708si2927492pga.103.2023.06.25.04.44.38; Sun, 25 Jun 2023 04:44:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231970AbjFYLfT (ORCPT + 99 others); Sun, 25 Jun 2023 07:35:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231482AbjFYLfR (ORCPT ); Sun, 25 Jun 2023 07:35:17 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D569106 for ; Sun, 25 Jun 2023 04:35:15 -0700 (PDT) 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769674889365930036?= X-GMAIL-MSGID: =?utf-8?q?1769674889365930036?= 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