From patchwork Wed Jul 19 09:58:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13318699 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 7B129EB64DA for ; Wed, 19 Jul 2023 09:59:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 92AED280047; Wed, 19 Jul 2023 05:59:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A63528003D; Wed, 19 Jul 2023 05:59:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F7DB280044; Wed, 19 Jul 2023 05:59:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5C26328003D for ; Wed, 19 Jul 2023 05:59:03 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 297F2C022C for ; Wed, 19 Jul 2023 09:59:03 +0000 (UTC) X-FDA: 81027912966.05.1107E49 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf05.hostedemail.com (Postfix) with ESMTP id 8CD9B100003 for ; Wed, 19 Jul 2023 09:58:58 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 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=1689760741; 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=K8o6BWlfGMRIH5Xj9IB+/vocef+3WReadbrYKfu8L3QK8BCeFfFdeWRX8NujonJ5PuX+Yy NJj+VjF0DFq/9YvdYEmDrqDCllEr9Z4ZZDqyhpv0dqUNh9UepIkLX6SjOrRr/QB3wGN/Ub B26slukMg9xNoQeTTljksHldjMF59Xs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689760741; a=rsa-sha256; cv=none; b=wk3gQLQ+hYd5bqNVwkWP9yn2kvydscwPHF5MAHU8LnJNwSHcjsWvdgUOiuyJUDdR/3agmv DCE3PxH5dzqdDwcKDi+ggnd0vMSsls3nSI0v6anAHwVIzTCOW2SULlBXnF3qUpjC1Pkoqe TAtG0qeHaD5uAjDsD2jdUWF9/UrZp24= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 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.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R5WQv5t2TzNmPb; 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 2/9] mm/page_io: remove unneeded SetPageError() Date: Wed, 19 Jul 2023 17:58:41 +0800 Message-ID: <20230719095848.3422629-3-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 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-Rspamd-Queue-Id: 8CD9B100003 X-Rspam-User: X-Stat-Signature: f5u5jfsi9x566k5yrshd1w7c16di3t6d X-Rspamd-Server: rspam03 X-HE-Tag: 1689760738-809188 X-HE-Meta: U2FsdGVkX1+dND9z9vA9RrEifSEmx6QLUC0wyG7zU8MyrchoDWN+yEL6VdP1Ln2mdp6QHc4K751K+PofhSvzPtkxCr58c1Ag8VEJpOrmY7dVp9PoblMUr7W3WzE0mzobCspm86NHLe5Vwt82NV2dYI3Huw2Xj11XhjZQGLy2KSXKgn93zfxW6vRAbTgi5GaagIHbGcrhpsDhSXhuoRmFX32vkaw2S404lzKhJx5bp9CPF5B/1gJC/phJDNXtv2eoEOgo3FuLXYNApOLsLMgktNiPwETcSKpCk741w+vBJfKLOOO628dhpawh8jaonqkVpU6woeDAgwTBW1zlHCMAFMbmkyxD8mRA4ZqVYjnW9ydxNf6szj+3lD/kfI79h8DmdBllx3oG/Y5Q9/iue7mdZSGUwLV7HMVYv4FVU91Uu+SiPhF1zonnF9LJIjCgj64+OV/GxSJes7h9lMG2i8s5X513tE8hc0+u8y+uyWS5CSC5RZAXpxI8N1Jy82z+hXz9FcVhlxlnlwJ4luE5efSgAPxVFVBvZ5wxvzCY2NuLcHTud/adeMbyFu5GG43v2PjUZGR03tEfpk4/vPYL021cv7zkdxibL30zaBX8Q1tPH6hNWZaQyCD0/x5SqSoLedJV27B0U8O95HidNo9ioalZ5LZrn/GANf6/OQtM0P63M+ABwF+Q3cMpfSGeJUHTJfYawIwyEoLsMARuvNWtEs8GVfuLUoIQYnCVijcehlnP6iFroFYFB3+rjVwxcbCoaFqpmnmOt0oBGeazlz8XFUUGNhR5H/6g3972u/GKY+2i4Z3NzL0KmoyfEdRMmWblNQ5WtzVCBYNU08chQY/+5upCLmKrSD0hhIqEDK5hNAW5RmQHb6JafTs8d8iqDV1QpDXQQIAQA1BnEGqVjI+N+OZ4aok2TusH26+vke34O0qI4sl2ObvgQB2L2P5XVz2nJItDOASTv5UqvemOceNmMEf /qEH0lFq OI8D3FE39xV0rgkxPwkWu34Bb2uVj++108iHgleSN3237oGYewUqGa8yPVOSUWg64cECXDXYtjBTQj7blvG6iXoCLG54J8SUJPL4cTolQ7eQ+E175Fbbs2z12xlSzq+7RB5+6Ikp5ef98RxFF/zKXwiTILK4bnE35NJ6Xc+z3GGg3+jxyzUUntJpWoSM6+yZkj/si8Gbx+570Sqz2kTjgTaxrsl2Lp+XDJ8UQOISroMpd9cJn2rIqLpPzVw== 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");