Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10400357rwp; Thu, 20 Jul 2023 21:15:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlEYiWIsPLu+LnjZHsMlI/SieMI1zk7NJHPJZGerWAsKmyxqb6dNbEMeHwpW9+h62sjFgrPu X-Received: by 2002:a17:902:7610:b0:1b8:b827:aa8e with SMTP id k16-20020a170902761000b001b8b827aa8emr672185pll.11.1689912935839; Thu, 20 Jul 2023 21:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689912935; cv=none; d=google.com; s=arc-20160816; b=rix2Q8qCQFCgs0WDnag4/aw3FKNf/cJxniH8754d7Y7HK8BvprXKg69HIROqaB33sM BF5hMaFIWgggZDt5zOR8XHY9mN4C718FpL9FUMLXnyFmdgBu5b9MT0sASwUQxJ4TaWxc irYOGLUgefMNTbRutGqBvRAvXOzvccl8cZDzoFeAOlWoTKmGcRXeiA3wWxTLxnEy5iO5 icXhxPcvhIXoh13Q38v0ldoz94M/gmC3MoS19zCJ/6MdmmwrtGwODs2a18E08EAOqZTl CYTx5xL9m6okungyV7ECPTGpDycy78vASJQH7w2wSaS1J6YFFWltX3ek1E2uBL4PsTSx nHag== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pYlzkQAdk4AUL+lQrQcLU4TJsQEB6E3ePvUtD+d2i7U=; fh=q8rOnvZaN5Z50YvgZS1uBArX5ZcEEwPcusRFazgmNUQ=; b=KttMYZTaTL4XOgxLpd8/rDvZEY1ONSJ0JMBhu/PJNv5p3ibYwe7aDnTc4og6D8LcWz 4HDqUQAWjmuKTgl+CHzGK6FfLt2Ndogs03qZoEH4ImjEPhOa7tKwe2fWcT6vIOyfla8L GWVbmiMCD5XtssPSXH5vpvuFJTybhCqGEqbANvAQ27TgDSb37Tp+trHNDG3BiB1HwwAk DuRS70lhXFE4jv4J21ZDyMtM9svnjmRQktOgeRUA55ev7C4ogQEyVRt3N/it37fXpvNU zFYdDBlAsf0GWKCIOZPMi4W6nt+iHaTYOvlpEuTxpLyMr8U2grgpmA/gU5HYH+lzilvs Nsug== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jz8-20020a170903430800b001b89b7ce902si2157934plb.305.2023.07.20.21.15.23; Thu, 20 Jul 2023 21:15:35 -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 S230074AbjGUDpP (ORCPT + 99 others); Thu, 20 Jul 2023 23:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbjGUDpN (ORCPT ); Thu, 20 Jul 2023 23:45:13 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51EB32729 for ; Thu, 20 Jul 2023 20:45:11 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4R6b5g0PLYz18MC2; Fri, 21 Jul 2023 11:44:23 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 21 Jul 2023 11:45:08 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v4 01/10] mm/page_io: remove unneeded ClearPageUptodate() Date: Fri, 21 Jul 2023 11:44:42 +0800 Message-ID: <20230721034451.16412-2-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230721034451.16412-1-zhangpeng362@huawei.com> References: <20230721034451.16412-1-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 From: ZhangPeng The VM_BUG_ON_FOLIO in swap_readpage() ensures that the page is already !uptodate in __end_swap_bio_read() and sio_read_complete(). Just remove unneeded ClearPageUptodate(). Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: ZhangPeng --- mm/page_io.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 8741d3a0d48a..3087a69a014b 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -62,7 +62,6 @@ static void __end_swap_bio_read(struct bio *bio) if (bio->bi_status) { SetPageError(page); - ClearPageUptodate(page); pr_alert_ratelimited("Read-error on swap-device (%u:%u:%llu)\n", MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), (unsigned long long)bio->bi_iter.bi_sector); @@ -417,7 +416,6 @@ static void sio_read_complete(struct kiocb *iocb, long ret) struct page *page = sio->bvec[p].bv_page; SetPageError(page); - ClearPageUptodate(page); unlock_page(page); } pr_alert_ratelimited("Read-error on swap-device\n"); -- 2.25.1