From patchwork Thu Jul 20 13:01:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhangpeng (AS)" X-Patchwork-Id: 123262 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp3113075vqt; Thu, 20 Jul 2023 06:19:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlFCDk52/TDTycEIa0mnzDsHpFQuViKdPzQc8XunGsKzvsX7ENSgchwm94WurhIZD1cF3AUH X-Received: by 2002:a05:6a00:1487:b0:67a:c810:3cb0 with SMTP id v7-20020a056a00148700b0067ac8103cb0mr5994049pfu.3.1689859195931; Thu, 20 Jul 2023 06:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689859195; cv=none; d=google.com; s=arc-20160816; b=g6FccChMrivEWecl3XjUArbM/lWY1gY3E4dVzI4eoiJtyddUcGivmzAB3O7R7/RW16 yXLQf2domk30OkVCGDMQtgpigm9Qo2XqNrxq6FHOoBP1qtoDRCoTCOtJsiT0Bky58Sk4 FOg+RhiCqaOI+lsIbPXSfMpmBX21ZkVRtudDPpuY1ijJitgDBA0lE7uZL3daHBx+D27G SuyPlcaZv4kwUdihl6eNq+HyN9v16i6q1KPAvplDaU5dPry3+UlmCqZi2naQ3iqWJvrW Jhr5TcB3siHk3qCKjkpjsqD30QA8HXOWnTwcKEWnDY2qUF3cC00JUpC3j3YyFHqz1OtI idfw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t40-20020a056a0013a800b0067b77e7f472si909471pfg.402.2023.07.20.06.19.42; Thu, 20 Jul 2023 06:19:55 -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 S231400AbjGTNCX (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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771945796464492117 X-GMAIL-MSGID: 1771945796464492117 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");