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: Peng Zhang X-Patchwork-Id: 13320500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EADC2EB64DC for ; Thu, 20 Jul 2023 13:04:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D19B280109; Thu, 20 Jul 2023 09:04:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7825228004C; Thu, 20 Jul 2023 09:04:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64A00280109; Thu, 20 Jul 2023 09:04:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5148228004C for ; Thu, 20 Jul 2023 09:04:07 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 099F480252 for ; Thu, 20 Jul 2023 13:04:07 +0000 (UTC) X-FDA: 81032008134.20.FDB12C1 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf17.hostedemail.com (Postfix) with ESMTP id 53DB0401BB for ; Thu, 20 Jul 2023 13:02:21 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689858142; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wN9Jy/8pPyEHOuZ2Lb/sCQ9C45wtfFLi31VZgiAcDtY=; b=Tvy/ELn5rBzA8TbzhT77qoOigH0n03o0P3P2WGf6OhbbUKsRxX+KfJ/HYOuttWz7P1RUPm z7/Kbwqomd5gTUT88YYNx8fTgFjXdBzZb3vh6vSGgfV4k2CN4KM1ILS43tF5edcS2WYcNu OPwB2XNMvRbd9UfsE5+1Z3OgST7ezmI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689858142; a=rsa-sha256; cv=none; b=G/oYOjCZRyAtXJjMNH5lOQT1+XPQoasbjeQuqGm+liXGO49ZcwYQ8TSy9Ng1IiNJsMigPd bh26BYTbpRVc4e09rRrsyjW4XD24Zu1lEL4w9Wz71o1ZguwyNXtgRp9/owNV7aEFDlZkx/ 21Mpe/BzgcjF8Of/hnURWWmxnYDnY2U= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com 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-Stat-Signature: cg8guseoia8oybkekor6fsjjprrc3yu1 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 53DB0401BB X-Rspam-User: X-HE-Tag: 1689858141-324360 X-HE-Meta: U2FsdGVkX1+FE/cTOCRYvNC6z9/nND7XqHyoQJ+izkU2omDPHVVy8O4GEuc7ofM0Zs2eZyVqDbdddSu3kg5a5a6LJDxdnb1pYDts7FTRELl7qeRKFMem8a8y4SgmHr3rq4Sf6DBj7JpjT0Eu8nGVO7IHNzQfyv+paGxF2KCXXhSSeVr3YO6h3IOd7+2OAyuARA5W8ShQhOwaNaUQ0mTxibvlGWwbT7lTkEOpqKU9Jj6TgSPwKdlnYI/vIOUNAXsJ/u0KBFTfGwi9CwX/wgRQ7l8PP1S/5jXLCVn1WuniuXa8A+X6DWq2nCS+jsO68pxzMRjPp/sRb6z2EKZ26thIsogGLWQMkLSQlLOsxorjQKwGoFvfdeaAYuZjSKSuyc+KJ5prCA+bbiw2Ahqvu5ldWayejnpUvGV4wFKF+qu7q6ZJp1FWnOmwQk24XyHNsR2pgkTZwxvUGrKcOvb6yMTyjE6wDv/gcNnAF70g+5ECyGUdkBLdnXc+nkrsE2H+lxEotaCCFQ2c3Nb4gAwy45DPQM2wQXmZUPkG5fGdaGYrcIA+ByF0sZzvpjvBEBMMJilwRWgj9caPGlOwKPd9d6Sku/pZmdwSWLPTOAtumED1yAEaZwimASU6L4rXhA+227P61ZkdZOYZkeD2ly7UrLH1WrxIOAmCtG5qLDlLorLn8UDcjwDLvUNxJNifOLC7qS4hKGtMqdrIrObHFNHKawlvcCLM9P9QSSUx1W2l4X1y5rQPCiTru5tEfL5becV3edqPbbNCdexnBk8yfR9jWrMSF155dLvsQyoNgp8pFpO3WHWUrPqSfWFR+7ttGlqQJC2M0MzJNDQ6RHP1ZFudnDwpzvQO4weF7NaarhK023/mwSenWM3u8fcIZ+mPpIlTb9tFkQ0fLBHo3LayjZJMoX9KQm3H02H9AzI3VqW5KSLucBOkzVnaL/Q9S8IJ5o9/R/nALIn0BG+5qn3jTIqYq8A YvKckkBK wrv3TmUQwK5CsSv2IPG6tOa0mRMj8ewIyfjivm7lW/Xw9WqZwXw19XR4x1oygB2ojpB7Q/h2SUsWJ3uRnnfC1t8cxGl3llR6DiXUJNICrUBPMyjEQpHe+V+10MoHIUAPizwvZ3HYxtYint2+mjIChTWo0V22BjaH8ZbYAFwHbYgSHhk4OzEQgEXHkLbhXFBXpNZ7f3xV5nNKoCkaoI3t/jJepcplmxzcGJRDkAayQYqWwt5widtdpteEolA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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");