From patchwork Fri Jul 21 03:44:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13321297 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 41348EB64DD for ; Fri, 21 Jul 2023 03:45:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B58C28018B; Thu, 20 Jul 2023 23:45:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4641E28018C; Thu, 20 Jul 2023 23:45:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1325128018B; Thu, 20 Jul 2023 23:45:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id BB86128018D for ; Thu, 20 Jul 2023 23:45:18 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 820C714012B for ; Fri, 21 Jul 2023 03:45:18 +0000 (UTC) X-FDA: 81034228716.20.E977D5C Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf08.hostedemail.com (Postfix) with ESMTP id A533516000B for ; Fri, 21 Jul 2023 03:45:15 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689911116; a=rsa-sha256; cv=none; b=wuipYHp7IofKeQISZ2PafJRITNNoNIcoObTxmQPmZwsOG7gWa5zcT0bvv5aX5xVxcGzUn+ EbWAWVbIv36E4c1oROcDbwu/8MgnwUW6uMTZ+3t+5O9jV2iCp2sV+HvngY60td6XMp3lb9 08u4pFd8HuaNJJ0pEwnKtOdVnmYFJ4g= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689911116; 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=pYlzkQAdk4AUL+lQrQcLU4TJsQEB6E3ePvUtD+d2i7U=; b=KOtioq36HFE3JLecFRwXgoIZflowynsB5atPBKT0HA473dpLWepD8w19F1duYxUOhy1dEw 06Ct4CiY74FUf7cM+Q9WudpW9Cmw5oHQhb6/YThsyEkQyb01QcIxBhv8i6I3H84YTUPdMh oq5ndVemeNaHxVkXTKLPzHCHJVjhbYo= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4R6b5g0PLYz18MC2; Fri, 21 Jul 2023 11:44:23 +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; Fri, 21 Jul 2023 11:45:08 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v4 01/10] mm/page_io: remove unneeded ClearPageUptodate() Date: Fri, 21 Jul 2023 11:44:42 +0800 Message-ID: <20230721034451.16412-2-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230721034451.16412-1-zhangpeng362@huawei.com> References: <20230721034451.16412-1-zhangpeng362@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A533516000B X-Stat-Signature: 7nmw46ado1xrr1t7yjj4wuxh67qjijfz X-Rspam-User: X-HE-Tag: 1689911115-661978 X-HE-Meta: U2FsdGVkX18z6EjAp6CmLRztFUxSCfRGG/PeVAeq+OcAP7YOCSMjr2Dx9a7DCP4+L9WCwQlDl1w1twAC76e+G7l4WlU4R2p3uFEpyGjcFrwtTdM5CrgnJ7S5NPO+UidK207ZSZGufSIOG2RjOCT72EEq9sMQfu1h9bi2LLmWw/0y0PB4Hhy53wmhugWNmynOo4zddKyvUdYYDmmGS4GfMj/9Z9F3lYIuaFnygJ2dLrLISmqleubWmgO3hvl+fLGaXq6dDPWAOivBThSpFscvGvwieSUWgBCvpS+Fqw88wWKGSbezG9QGTII+YhZuLDThQ7IlVoTWRZ0pCUwd1TgzTZ14uJaSoduoddee4cSsZiJ1fqlPSXjbqXxb1yF/EB+pe3ykoTrzd+hSgdYC9a6mwwAGLdPp0NR/ibxKTPdARWnm/xPvq1Yui7H7vD+JyemBwhHgeL0sq/qCbG3YCL3fazZ+9hdH8kvkPEHNfRKHp+Vk/cLfxAzEma4KthX2w14mpJFx3yAjRkQLB92TrRC0PACr2rXW3/JSubiagh1+btj6H4guFRt/zDSTvISKUzHqad83OO+YMhsn9R9jvUyLsEIjocQSUQnqE5gh47yyASdD6VRcq3JoLIRQt6pOS8eR5UbHYtxJ4BA1MHAfUrI35+tEurZo1JdHuF1jIv77zQtW+ku3ruSRpUSaRBtMOdITaFUCWMe0QcvKiG0SUir9prZue6gr9S/5CWTk43rMg3LMwjwdOfGOFVnhwTsIu4wZ+MQGu95OVxC7zSk0sr/uakvck+wo8LgFUEESc2Rs8YDoQJfVNQqaxQA3Hf/jgab0TX3sp+dMvOlAI8WseAK5xQU3+6Do5U/ko3kpxu/Gm8srr+5ynMBsEx2q1QGPph4X3urMNmJIDzviw/9KIFMaleN82zWvs3PqoKvZDF3O7PKXha+9QdYIa6pgXWJJDT1HpFozmKrgdLwCqOQ8ZMR BisKA+iD CUvKn5Zd6WhP8rW3riAMVbzEQLuZI//WS56repnGrU4MZuEQLxjS8VIkVl8GbFdWRBOmYNb0jfw2KvqF04StRvGCIzKQQ2LPufvPb84T6OAWji3iynQCrVIUpjlh2Gu3TC25JXsk8bufVre6vwdFHWYkMJhUuEe1+QOMPV/CLRuqUWQtBPimdeHjqME52k406Lro7FaDRvkK1Wi2PCj0bfH4SujiPEoeLPxggDrB33Kg+vW4UyOABhxVJaQ== 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 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");