Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7957612rwp; Wed, 19 Jul 2023 03:05:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlGrBlZuhwkG87xIU8ZdIhX82U5gHJrOvg1XqnMRFythkHlwIZpbyXXQ2ZGK4aJoZufx9QA0 X-Received: by 2002:a05:6a20:430d:b0:133:6816:c889 with SMTP id h13-20020a056a20430d00b001336816c889mr2576979pzk.40.1689761119294; Wed, 19 Jul 2023 03:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689761119; cv=none; d=google.com; s=arc-20160816; b=VEtg7MBLD7vYYJZhT7M0oGFBp1vezU9eEJnXGb8pRdjP5TXmdVlNKc8W86HOYe6M6h SpdkDC5HMC0DuJkaJFT/o3xl6cWEsoJnplREZBdysWkAMGldXAsLeFVu40EcdL6O6cR3 MKfcy3qnMLzyVor+HM/QRYvNgBXGipuDtISXVvQVfbJqO5c0J3KpU+bK5ALD6x+6mJlC bSPicSLxhQ6/zhQy+tcY3AxpRlKW0p/pPw4J8eSwMEqvI4OBEORPCUnAJxkOpKmLMkdb VUR2WjfclT4t7L1agvru4hAmZKcn4+sC6W8CPncNkIyVVED0vFLeWDHltDlVURphX1Oh jvwQ== 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=fQ8bSAglEIUMWaW8g2fbwjC8kqQICqHTc4sMCYJe224=; b=xgnLRq+NplPmsS/4FuLcMkNdZ9oEAWEUv+tjwg43/tt2t56BRTuG1AiYjVTdLXf71O tUKH+Gg5rmtKLmItSVn/0wSFHWs+2AFNMhJHi9lhTkuXQzkf+Bz1mAO9BWkj0+NMHBE2 kgrUKC9TIkJvgo/cUGmZDyoVCoPFaUnuh1+dqeDtrdcJvQow+OpdVWUiWkUAOolPDehI 0lHz3mXc3jw6+PZjkLJDwlOHh2uWM2buYEdTaj2FjUdcKGSm5GoTOPLRrrAIPQCKWRW8 ba4o4dh742G+OHcPnaMC66USWi8xgkJ8M8AfR27sLEMWKWMtJ34k0+UhlGPlCx1ihacC 98CA== 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 j27-20020a633c1b000000b0055baed7e7e9si3204542pga.653.2023.07.19.03.05.05; Wed, 19 Jul 2023 03:05:19 -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 S230252AbjGSJ7A (ORCPT + 99 others); Wed, 19 Jul 2023 05:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjGSJ65 (ORCPT ); Wed, 19 Jul 2023 05:58:57 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5C101BFD for ; Wed, 19 Jul 2023 02:58:56 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R5WQv0tvZzNmSH; Wed, 19 Jul 2023 17:55:35 +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; Wed, 19 Jul 2023 17:58:54 +0800 From: Peng Zhang To: , , CC: , , , , ZhangPeng Subject: [PATCH v2 1/9] mm/page_io: remove unneeded ClearPageUptodate() Date: Wed, 19 Jul 2023 17:58:40 +0800 Message-ID: <20230719095848.3422629-2-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230719095848.3422629-1-zhangpeng362@huawei.com> References: <20230719095848.3422629-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: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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