Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9534966rwp; Thu, 20 Jul 2023 06:26:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFuYctYJikPguOk7tnEVV0t2fE6VFwgbfwqeVqKEMTl2osxm5JrHKY1Jgbgt+p2ryyA7lLz X-Received: by 2002:a05:6e02:1d8e:b0:348:8541:d969 with SMTP id h14-20020a056e021d8e00b003488541d969mr6027525ila.12.1689859572437; Thu, 20 Jul 2023 06:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689859572; cv=none; d=google.com; s=arc-20160816; b=gMlL2xyRxYdH267xLa1AD9CnYLy2c9b7hkFqrNAjqzsF31y+UFxwL2xBqIGA6b5Zoj mFqZAetI+0PGqZtKGj57b+8RtMkMDtlmQ3fyshrvbTcDf4yaa/G07LMrwK7o6Eq5Tfqf hWwNlzTLNypEkOe+Q2IU8x5pxMEmhoVcwClJs0gU1EGiFc5qghmZ3QD9fKpyEyBt1qsd 9iMcyid1UxMnQIg0H6tth4WQUlXE10Q0VNogmLApj/ECf52FiaC+awACe0/P8+CFtIBL LQdDI6kW/NBTp/Tx1AFhgazfZmlz4+kgWCwL7z2RCoi7Zt//F8vbFhp0SnOC99FZhFH1 VQ2Q== 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=wN9Jy/8pPyEHOuZ2Lb/sCQ9C45wtfFLi31VZgiAcDtY=; fh=q8rOnvZaN5Z50YvgZS1uBArX5ZcEEwPcusRFazgmNUQ=; b=0NJBAUeG9BWOdQEYchGuBILlOJWG98YfncIgsfa51PSOSy4V98XzB8W495/LGRkSDW Lhdvf2NxY0Fgf+JMo9lERZ6em0+1IjJieGVkhxSCuHGUGXqMO1t+ovkaHnzoRipv9me+ YCnqZuT5NM8KFlZwpwowbbkm0NZ56s92xrcG8Phn8G4kqbyC/QibBJ5Ouu2KVKv0AqyS vb5LvfvdjPaYyvkuSSMnWZqtGKnqRP+6SUaarV1dN+e6v+NBQfR9qaAWJLDGg3oT/GJc HlXoOG6WZ/r9GO8V+BZibJxr40lM5GFvX7tJBlIu2BCErapKzZtSbBPxhaG4peV+V4iR 8nmA== 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 q19-20020a170902bd9300b001b7f9517794si891778pls.384.2023.07.20.06.25.58; Thu, 20 Jul 2023 06:26:12 -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 S231361AbjGTNCX (ORCPT + 99 others); Thu, 20 Jul 2023 09:02:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbjGTNCU (ORCPT ); Thu, 20 Jul 2023 09:02:20 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 706E7269A for ; Thu, 20 Jul 2023 06:02:19 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4R6CSz4RdrzLntv; Thu, 20 Jul 2023 20:59:47 +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; Thu, 20 Jul 2023 21:02:15 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v3 02/10] mm/page_io: remove unneeded SetPageError() Date: Thu, 20 Jul 2023 21:01:39 +0800 Message-ID: <20230720130147.4071649-3-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720130147.4071649-1-zhangpeng362@huawei.com> References: <20230720130147.4071649-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,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 Nobody checks the PageError()/folio_test_error() for the page/folio in __end_swap_bio_read/write() and sio_write_complete(). Therefore, we don't need to set the error flag. Just drop it. Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: ZhangPeng --- mm/page_io.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 3087a69a014b..5ddb5d9c5013 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -32,7 +32,6 @@ static void __end_swap_bio_write(struct bio *bio) struct page *page = bio_first_page_all(bio); if (bio->bi_status) { - SetPageError(page); /* * We failed to write the page out to swap-space. * Re-dirty the page in order to avoid it being reclaimed. @@ -61,7 +60,6 @@ static void __end_swap_bio_read(struct bio *bio) struct page *page = bio_first_page_all(bio); if (bio->bi_status) { - SetPageError(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); @@ -415,7 +413,6 @@ static void sio_read_complete(struct kiocb *iocb, long ret) for (p = 0; p < sio->pages; p++) { struct page *page = sio->bvec[p].bv_page; - SetPageError(page); unlock_page(page); } pr_alert_ratelimited("Read-error on swap-device\n"); -- 2.25.1