2023-07-19 10:05:19

by zhangpeng (AS)

[permalink] [raw]
Subject: [PATCH v2 1/9] mm/page_io: remove unneeded ClearPageUptodate()

From: ZhangPeng <[email protected]>

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) <[email protected]>
Signed-off-by: ZhangPeng <[email protected]>
---
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");
--
2.25.1