From patchwork Wed Jul 19 09:58:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13318701 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 0D5DDC001DE for ; Wed, 19 Jul 2023 09:59:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8A92280044; Wed, 19 Jul 2023 05:59:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D1946280046; 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 9280E280044; Wed, 19 Jul 2023 05:59:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 81643280045 for ; Wed, 19 Jul 2023 05:59:03 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4BED8C022D for ; Wed, 19 Jul 2023 09:59:03 +0000 (UTC) X-FDA: 81027912966.07.D53875D Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf01.hostedemail.com (Postfix) with ESMTP id A56E040005 for ; Wed, 19 Jul 2023 09:59:00 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 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=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=pYlzkQAdk4AUL+lQrQcLU4TJsQEB6E3ePvUtD+d2i7U=; b=jcYeqZs+ZiXZtli7LuQpz8Kkdo4Fk4Tb2/pFnp4IpRtw0sdG0JKLHZ0zq1IH7DqNywX26K wC/eFf42gZ1gr5/CctlSLC0gIn8gk68ZM7AUGXN6LUiDDREZ6d2KXf89Cz4ZMSyA55ak3H YfnM0oBiDZgbFA+6w0/mdF+CNC87OyU= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf01.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689760741; a=rsa-sha256; cv=none; b=E49oT10MgJJX52mzdRt6XiGzzmW+s/QCbcJv4X7/d2Zd9F2dx5zQF260oEMhL6UCSgtUW7 W2o+5bl+DeCipGtAHQY1KxnaI6MebYOn4zkwxoD5K81uaSTDqW/YdzZ2ClVsNJEhWEhHfQ Fzrdgl0VZJvdsRJDH0COdGQ5JNhB1sk= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R5WQv0tvZzNmSH; 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 1/9] mm/page_io: remove unneeded ClearPageUptodate() Date: Wed, 19 Jul 2023 17:58:40 +0800 Message-ID: <20230719095848.3422629-2-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: A56E040005 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: jjja9inuez1st5671udq5z313ngziaz3 X-HE-Tag: 1689760740-149606 X-HE-Meta: U2FsdGVkX197AVrNp/oOcZT5pFIZ7iwV4Ebp01dRn9kEd+ZM1ouVBqIQ7xRlsvyqgdTNgSzZMjpVMV/UGQZkk8rNtxuqZ8xs+5P/mDZ6WJL4ZbGUT9vfYUjYbivXrffjNs5jT5uRbpBHOkzJIjwlbl1iXKNkmpV5KTR8b/lGgTLe2IdeR4LJTj/uhfZSEMYh6SnbRHD6YJvDhjFjWc3wkexD/x1vVnsmdgz1aiZwuDrbyqzMbrnVe4Om6AZ3KwKOFefQ7kiAxwg0ecVp/jOEV7m2Itg4Sj23XzApLADOW2SH0ncjYQcHlNfzpCQXdJcF7inFHc1rIHVj3JBmMu82igFYHJceJcXV+bsI0rc8DybSt9lf3XWgk6JERZn3/Q2DCn/N5tbhB5pKRs3SzgMmemcOiUGBAMLMTSz9JfNrZs0QfZZrgFhHTf7QsuyAhxdWOJFrnG6482ZUqVKVlqz9qsrPwKCFQQr6Ejbe8idRbz/XJWHB52dGsiSkB+PIiIkjeMpojGHx/MfL0PD3NYDdvKY84zG2qhLTOt/fRqSAUiscRLOpkmQ0MMphbmQolfoAkYNoE4BM0l4+iRl0zSmo5ZiNTig3Mui1Yfwh8W36u/ZBgAoHlhSti/yrK7kmDB36NsuJM2AvXp34HdNKaYD6ZSkZ6ykVXdJZGr4pM03zClLmCLKG4Emj5gQ95h7uwiXU87KxMzc+GtrNHpIzjY8REE1SkDHQqd6Y2y1noU0IPVYT1c63onlrKv35PX5yO+AcFYZ3Ko8AzlUaSUZzY1V7ALlfxcFwMI7cujht3jTgJJwwzLzzMb7QDmF+/1FIW70q88Y/kpFkl6nGarrD12n48k0NWYYEyH5Zt7DvVLpQo8RHE9MjDzRKVHngqNdXb8Dc89Rv0cvenA9vzW2feIfSkCDKeP5evC3NKLxqGgI9oH83J+FpOtORzHl1ecLztxnBlWvRjVkJMQLOOz9jIyD 7RXPCc6o NbfxtHMxPB1nOLRA8Mu15u6W3xnvKJi5Q/3QX5hnLlc31weav5upI1Qbafr0gEXp8Nz6BKRyDoMyMLna6eF1Skee9YNSY+qaMi2265RZeP3J4Jhxoi0UgAaSQTE5P1r+x47p5ar0zM8x0qpCfNXcIs+/Z7HLjpmLLP0aMMYsMSxfG1ivrBCl3t04fNMRLfXgCL2pBCx01tUVclXQEMkdCOW79BE7xbLi+Swaz+CcCEFbR8UbZVguddOCiiQ== 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");