All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/10] Convert several functions in page_io.c to use a folio
@ 2023-07-20 13:01 Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 01/10] mm/page_io: remove unneeded ClearPageUptodate() Peng Zhang
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

This patch series converts several functions in page_io.c to use a
folio, which can remove several implicit calls to compound_head().

Changelog:

v3:
- introduce bio_first_folio_all(), rather than replacing
  bio_first_page_all() per Matthew (patch 3)
- use a folio in __end_swap_bio_write() (patch 4)
- remove unneeded ifdefs per Matthew (patch 9)

v2:
- remove unneeded ClearPageUptodate() and SetPageError(), suggested by
  Matthew Wilcox
- convert bio_first_page_all() to bio_first_folio_all()
- convert PageTransHuge to folio_test_pmd_mappable per Matthew Wilcox

ZhangPeng (10):
  mm/page_io: remove unneeded ClearPageUptodate()
  mm/page_io: remove unneeded SetPageError()
  mm/page_io: introduce bio_first_folio_all()
  mm/page_io: use a folio in __end_swap_bio_write()
  mm/page_io: use a folio in __end_swap_bio_read()
  mm/page_io: use a folio in sio_read_complete()
  mm/page_io: use a folio in swap_writepage_bdev_sync()
  mm/page_io: use a folio in swap_writepage_bdev_async()
  mm/page_io: convert count_swpout_vm_event() to take in a folio
  mm/page_io: convert bio_associate_blkg_from_page() to take in a folio

 Documentation/block/biovecs.rst |  1 +
 include/linux/bio.h             |  5 +++
 mm/page_io.c                    | 63 +++++++++++++++------------------
 3 files changed, 35 insertions(+), 34 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 01/10] mm/page_io: remove unneeded ClearPageUptodate()
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 02/10] mm/page_io: remove unneeded SetPageError() Peng Zhang
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

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) <willy@infradead.org>
Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 02/10] mm/page_io: remove unneeded SetPageError()
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 01/10] mm/page_io: remove unneeded ClearPageUptodate() Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 03/10] mm/page_io: introduce bio_first_folio_all() Peng Zhang
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

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) <willy@infradead.org>
Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 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");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 03/10] mm/page_io: introduce bio_first_folio_all()
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 01/10] mm/page_io: remove unneeded ClearPageUptodate() Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 02/10] mm/page_io: remove unneeded SetPageError() Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 04/10] mm/page_io: use a folio in __end_swap_bio_write() Peng Zhang
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

Introduce bio_first_folio_all() to return a folio, which makes it easier
to use.

Suggested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 Documentation/block/biovecs.rst | 1 +
 include/linux/bio.h             | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/Documentation/block/biovecs.rst b/Documentation/block/biovecs.rst
index ddb867e0185b..b9dc0c9dbee4 100644
--- a/Documentation/block/biovecs.rst
+++ b/Documentation/block/biovecs.rst
@@ -134,6 +134,7 @@ Usage of helpers:
 	bio_for_each_bvec_all()
 	bio_first_bvec_all()
 	bio_first_page_all()
+	bio_first_folio_all()
 	bio_last_bvec_all()
 
 * The following helpers iterate over single-page segment. The passed 'struct
diff --git a/include/linux/bio.h b/include/linux/bio.h
index c4f5b5228105..027ff9ab5d12 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -253,6 +253,11 @@ static inline struct page *bio_first_page_all(struct bio *bio)
 	return bio_first_bvec_all(bio)->bv_page;
 }
 
+static inline struct folio *bio_first_folio_all(struct bio *bio)
+{
+	return page_folio(bio_first_page_all(bio));
+}
+
 static inline struct bio_vec *bio_last_bvec_all(struct bio *bio)
 {
 	WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 04/10] mm/page_io: use a folio in __end_swap_bio_write()
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
                   ` (2 preceding siblings ...)
  2023-07-20 13:01 ` [PATCH v3 03/10] mm/page_io: introduce bio_first_folio_all() Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 05/10] mm/page_io: use a folio in __end_swap_bio_read() Peng Zhang
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

Saves two implicit call to compound_head().

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 mm/page_io.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 5ddb5d9c5013..d9f5fa5b7281 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -29,7 +29,7 @@
 
 static void __end_swap_bio_write(struct bio *bio)
 {
-	struct page *page = bio_first_page_all(bio);
+	struct folio *folio = bio_first_folio_all(bio);
 
 	if (bio->bi_status) {
 		/*
@@ -40,13 +40,13 @@ static void __end_swap_bio_write(struct bio *bio)
 		 *
 		 * Also clear PG_reclaim to avoid folio_rotate_reclaimable()
 		 */
-		set_page_dirty(page);
+		folio_mark_dirty(folio);
 		pr_alert_ratelimited("Write-error on swap-device (%u:%u:%llu)\n",
 				     MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)),
 				     (unsigned long long)bio->bi_iter.bi_sector);
-		ClearPageReclaim(page);
+		folio_clear_reclaim(folio);
 	}
-	end_page_writeback(page);
+	folio_end_writeback(folio);
 }
 
 static void end_swap_bio_write(struct bio *bio)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 05/10] mm/page_io: use a folio in __end_swap_bio_read()
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
                   ` (3 preceding siblings ...)
  2023-07-20 13:01 ` [PATCH v3 04/10] mm/page_io: use a folio in __end_swap_bio_write() Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 06/10] mm/page_io: use a folio in sio_read_complete() Peng Zhang
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

Saves one implicit call to compound_head().

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 mm/page_io.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index d9f5fa5b7281..3b97289153f9 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -57,16 +57,16 @@ static void end_swap_bio_write(struct bio *bio)
 
 static void __end_swap_bio_read(struct bio *bio)
 {
-	struct page *page = bio_first_page_all(bio);
+	struct folio *folio = bio_first_folio_all(bio);
 
 	if (bio->bi_status) {
 		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);
 	} else {
-		SetPageUptodate(page);
+		folio_mark_uptodate(folio);
 	}
-	unlock_page(page);
+	folio_unlock(folio);
 }
 
 static void end_swap_bio_read(struct bio *bio)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 06/10] mm/page_io: use a folio in sio_read_complete()
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
                   ` (4 preceding siblings ...)
  2023-07-20 13:01 ` [PATCH v3 05/10] mm/page_io: use a folio in __end_swap_bio_read() Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 07/10] mm/page_io: use a folio in swap_writepage_bdev_sync() Peng Zhang
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

Saves one implicit call to compound_head().

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 mm/page_io.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 3b97289153f9..7e7a9f67b9ad 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -403,17 +403,17 @@ static void sio_read_complete(struct kiocb *iocb, long ret)
 
 	if (ret == sio->len) {
 		for (p = 0; p < sio->pages; p++) {
-			struct page *page = sio->bvec[p].bv_page;
+			struct folio *folio = page_folio(sio->bvec[p].bv_page);
 
-			SetPageUptodate(page);
-			unlock_page(page);
+			folio_mark_uptodate(folio);
+			folio_unlock(folio);
 		}
 		count_vm_events(PSWPIN, sio->pages);
 	} else {
 		for (p = 0; p < sio->pages; p++) {
-			struct page *page = sio->bvec[p].bv_page;
+			struct folio *folio = page_folio(sio->bvec[p].bv_page);
 
-			unlock_page(page);
+			folio_unlock(folio);
 		}
 		pr_alert_ratelimited("Read-error on swap-device\n");
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 07/10] mm/page_io: use a folio in swap_writepage_bdev_sync()
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
                   ` (5 preceding siblings ...)
  2023-07-20 13:01 ` [PATCH v3 06/10] mm/page_io: use a folio in sio_read_complete() Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 08/10] mm/page_io: use a folio in swap_writepage_bdev_async() Peng Zhang
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

Saves one implicit call to compound_head().

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/page_io.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 7e7a9f67b9ad..9df2a85e31b1 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -331,6 +331,7 @@ static void swap_writepage_bdev_sync(struct page *page,
 {
 	struct bio_vec bv;
 	struct bio bio;
+	struct folio *folio = page_folio(page);
 
 	bio_init(&bio, sis->bdev, &bv, 1,
 		 REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc));
@@ -340,8 +341,8 @@ static void swap_writepage_bdev_sync(struct page *page,
 	bio_associate_blkg_from_page(&bio, page);
 	count_swpout_vm_event(page);
 
-	set_page_writeback(page);
-	unlock_page(page);
+	folio_start_writeback(folio);
+	folio_unlock(folio);
 
 	submit_bio_wait(&bio);
 	__end_swap_bio_write(&bio);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 08/10] mm/page_io: use a folio in swap_writepage_bdev_async()
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
                   ` (6 preceding siblings ...)
  2023-07-20 13:01 ` [PATCH v3 07/10] mm/page_io: use a folio in swap_writepage_bdev_sync() Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio Peng Zhang
  2023-07-20 13:01 ` [PATCH v3 10/10] mm/page_io: convert bio_associate_blkg_from_page() " Peng Zhang
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

Saves one implicit call to compound_head().

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/page_io.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 9df2a85e31b1..07bad3a4b701 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -352,6 +352,7 @@ static void swap_writepage_bdev_async(struct page *page,
 		struct writeback_control *wbc, struct swap_info_struct *sis)
 {
 	struct bio *bio;
+	struct folio *folio = page_folio(page);
 
 	bio = bio_alloc(sis->bdev, 1,
 			REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc),
@@ -362,8 +363,8 @@ static void swap_writepage_bdev_async(struct page *page,
 
 	bio_associate_blkg_from_page(bio, page);
 	count_swpout_vm_event(page);
-	set_page_writeback(page);
-	unlock_page(page);
+	folio_start_writeback(folio);
+	folio_unlock(folio);
 	submit_bio(bio);
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
                   ` (7 preceding siblings ...)
  2023-07-20 13:01 ` [PATCH v3 08/10] mm/page_io: use a folio in swap_writepage_bdev_async() Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  2023-07-21  1:31   ` kernel test robot
  2023-07-21  2:02   ` kernel test robot
  2023-07-20 13:01 ` [PATCH v3 10/10] mm/page_io: convert bio_associate_blkg_from_page() " Peng Zhang
  9 siblings, 2 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

Convert count_swpout_vm_event() to take in a folio. We can remove five
implicit calls to compound_head() by taking in a folio.

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 mm/page_io.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index 07bad3a4b701..da3f38404585 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -205,13 +205,11 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
 	return 0;
 }
 
-static inline void count_swpout_vm_event(struct page *page)
+static inline void count_swpout_vm_event(struct folio *folio)
 {
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-	if (unlikely(PageTransHuge(page)))
+	if (unlikely(folio_test_pmd_mappable(folio)))
 		count_vm_event(THP_SWPOUT);
-#endif
-	count_vm_events(PSWPOUT, thp_nr_pages(page));
+	count_vm_events(PSWPOUT, folio_nr_pages(folio));
 }
 
 #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP)
@@ -280,7 +278,7 @@ static void sio_write_complete(struct kiocb *iocb, long ret)
 		}
 	} else {
 		for (p = 0; p < sio->pages; p++)
-			count_swpout_vm_event(sio->bvec[p].bv_page);
+			count_swpout_vm_event(page_folio(sio->bvec[p].bv_page));
 	}
 
 	for (p = 0; p < sio->pages; p++)
@@ -339,7 +337,7 @@ static void swap_writepage_bdev_sync(struct page *page,
 	__bio_add_page(&bio, page, thp_size(page), 0);
 
 	bio_associate_blkg_from_page(&bio, page);
-	count_swpout_vm_event(page);
+	count_swpout_vm_event(folio);
 
 	folio_start_writeback(folio);
 	folio_unlock(folio);
@@ -362,7 +360,7 @@ static void swap_writepage_bdev_async(struct page *page,
 	__bio_add_page(bio, page, thp_size(page), 0);
 
 	bio_associate_blkg_from_page(bio, page);
-	count_swpout_vm_event(page);
+	count_swpout_vm_event(folio);
 	folio_start_writeback(folio);
 	folio_unlock(folio);
 	submit_bio(bio);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 10/10] mm/page_io: convert bio_associate_blkg_from_page() to take in a folio
  2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
                   ` (8 preceding siblings ...)
  2023-07-20 13:01 ` [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio Peng Zhang
@ 2023-07-20 13:01 ` Peng Zhang
  9 siblings, 0 replies; 14+ messages in thread
From: Peng Zhang @ 2023-07-20 13:01 UTC (permalink / raw)
  To: linux-mm, linux-kernel, willy
  Cc: hch, sidhartha.kumar, akpm, wangkefeng.wang, sunnanyong, ZhangPeng

From: ZhangPeng <zhangpeng362@huawei.com>

Convert bio_associate_blkg_from_page() to take in a folio. We can remove
two implicit calls to compound_head() by taking in a folio.

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/page_io.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index da3f38404585..cc2503bd511a 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -213,12 +213,12 @@ static inline void count_swpout_vm_event(struct folio *folio)
 }
 
 #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP)
-static void bio_associate_blkg_from_page(struct bio *bio, struct page *page)
+static void bio_associate_blkg_from_page(struct bio *bio, struct folio *folio)
 {
 	struct cgroup_subsys_state *css;
 	struct mem_cgroup *memcg;
 
-	memcg = page_memcg(page);
+	memcg = folio_memcg(folio);
 	if (!memcg)
 		return;
 
@@ -228,7 +228,7 @@ static void bio_associate_blkg_from_page(struct bio *bio, struct page *page)
 	rcu_read_unlock();
 }
 #else
-#define bio_associate_blkg_from_page(bio, page)		do { } while (0)
+#define bio_associate_blkg_from_page(bio, folio)		do { } while (0)
 #endif /* CONFIG_MEMCG && CONFIG_BLK_CGROUP */
 
 struct swap_iocb {
@@ -336,7 +336,7 @@ static void swap_writepage_bdev_sync(struct page *page,
 	bio.bi_iter.bi_sector = swap_page_sector(page);
 	__bio_add_page(&bio, page, thp_size(page), 0);
 
-	bio_associate_blkg_from_page(&bio, page);
+	bio_associate_blkg_from_page(&bio, folio);
 	count_swpout_vm_event(folio);
 
 	folio_start_writeback(folio);
@@ -359,7 +359,7 @@ static void swap_writepage_bdev_async(struct page *page,
 	bio->bi_end_io = end_swap_bio_write;
 	__bio_add_page(bio, page, thp_size(page), 0);
 
-	bio_associate_blkg_from_page(bio, page);
+	bio_associate_blkg_from_page(bio, folio);
 	count_swpout_vm_event(folio);
 	folio_start_writeback(folio);
 	folio_unlock(folio);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio
  2023-07-20 13:01 ` [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio Peng Zhang
@ 2023-07-21  1:31   ` kernel test robot
  2023-07-21  2:30     ` zhangpeng (AS)
  2023-07-21  2:02   ` kernel test robot
  1 sibling, 1 reply; 14+ messages in thread
From: kernel test robot @ 2023-07-21  1:31 UTC (permalink / raw)
  To: Peng Zhang, linux-mm, linux-kernel, willy
  Cc: llvm, oe-kbuild-all, hch, sidhartha.kumar, akpm, wangkefeng.wang,
	sunnanyong, ZhangPeng

Hi Peng,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on axboe-block/for-next linus/master v6.5-rc2 next-20230720]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Zhang/mm-page_io-remove-unneeded-ClearPageUptodate/20230720-210515
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20230720130147.4071649-10-zhangpeng362%40huawei.com
patch subject: [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio
config: um-randconfig-r003-20230720 (https://download.01.org/0day-ci/archive/20230721/202307210951.NCdscoSS-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230721/202307210951.NCdscoSS-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307210951.NCdscoSS-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/page_io.c:15:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     547 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from mm/page_io.c:15:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from mm/page_io.c:15:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     584 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     692 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     700 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     708 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     717 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     726 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     735 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
>> mm/page_io.c:211:18: error: use of undeclared identifier 'THP_SWPOUT'; did you mean 'PSWPOUT'?
     211 |                 count_vm_event(THP_SWPOUT);
         |                                ^~~~~~~~~~
         |                                PSWPOUT
   include/linux/vm_event_item.h:32:47: note: 'PSWPOUT' declared here
      32 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
         |                                               ^
   12 warnings and 1 error generated.


vim +211 mm/page_io.c

2f772e6cadf8ad Seth Jennings 2013-04-29  207  
c40c44eb86eb74 ZhangPeng     2023-07-20  208  static inline void count_swpout_vm_event(struct folio *folio)
225311a46411c3 Huang Ying    2017-09-06  209  {
c40c44eb86eb74 ZhangPeng     2023-07-20  210  	if (unlikely(folio_test_pmd_mappable(folio)))
225311a46411c3 Huang Ying    2017-09-06 @211  		count_vm_event(THP_SWPOUT);
c40c44eb86eb74 ZhangPeng     2023-07-20  212  	count_vm_events(PSWPOUT, folio_nr_pages(folio));
225311a46411c3 Huang Ying    2017-09-06  213  }
225311a46411c3 Huang Ying    2017-09-06  214  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio
  2023-07-20 13:01 ` [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio Peng Zhang
  2023-07-21  1:31   ` kernel test robot
@ 2023-07-21  2:02   ` kernel test robot
  1 sibling, 0 replies; 14+ messages in thread
From: kernel test robot @ 2023-07-21  2:02 UTC (permalink / raw)
  To: Peng Zhang, linux-mm, linux-kernel, willy
  Cc: oe-kbuild-all, hch, sidhartha.kumar, akpm, wangkefeng.wang,
	sunnanyong, ZhangPeng

Hi Peng,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on axboe-block/for-next linus/master v6.5-rc2 next-20230720]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Zhang/mm-page_io-remove-unneeded-ClearPageUptodate/20230720-210515
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20230720130147.4071649-10-zhangpeng362%40huawei.com
patch subject: [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio
config: parisc-randconfig-r006-20230720 (https://download.01.org/0day-ci/archive/20230721/202307210922.2swqazEA-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230721/202307210922.2swqazEA-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307210922.2swqazEA-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/page_io.c: In function 'count_swpout_vm_event':
>> mm/page_io.c:211:32: error: 'THP_SWPOUT' undeclared (first use in this function); did you mean 'PSWPOUT'?
     211 |                 count_vm_event(THP_SWPOUT);
         |                                ^~~~~~~~~~
         |                                PSWPOUT
   mm/page_io.c:211:32: note: each undeclared identifier is reported only once for each function it appears in


vim +211 mm/page_io.c

2f772e6cadf8ad Seth Jennings 2013-04-29  207  
c40c44eb86eb74 ZhangPeng     2023-07-20  208  static inline void count_swpout_vm_event(struct folio *folio)
225311a46411c3 Huang Ying    2017-09-06  209  {
c40c44eb86eb74 ZhangPeng     2023-07-20  210  	if (unlikely(folio_test_pmd_mappable(folio)))
225311a46411c3 Huang Ying    2017-09-06 @211  		count_vm_event(THP_SWPOUT);
c40c44eb86eb74 ZhangPeng     2023-07-20  212  	count_vm_events(PSWPOUT, folio_nr_pages(folio));
225311a46411c3 Huang Ying    2017-09-06  213  }
225311a46411c3 Huang Ying    2017-09-06  214  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio
  2023-07-21  1:31   ` kernel test robot
@ 2023-07-21  2:30     ` zhangpeng (AS)
  0 siblings, 0 replies; 14+ messages in thread
From: zhangpeng (AS) @ 2023-07-21  2:30 UTC (permalink / raw)
  To: kernel test robot, linux-mm, linux-kernel, willy
  Cc: llvm, oe-kbuild-all, hch, sidhartha.kumar, akpm, wangkefeng.wang,
	sunnanyong

On 2023/7/21 9:31, kernel test robot wrote:

> Hi Peng,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on akpm-mm/mm-everything]
> [also build test ERROR on axboe-block/for-next linus/master v6.5-rc2 next-20230720]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Zhang/mm-page_io-remove-unneeded-ClearPageUptodate/20230720-210515
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> patch link:    https://lore.kernel.org/r/20230720130147.4071649-10-zhangpeng362%40huawei.com
> patch subject: [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio
> config: um-randconfig-r003-20230720 (https://download.01.org/0day-ci/archive/20230721/202307210951.NCdscoSS-lkp@intel.com/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
> reproduce: (https://download.01.org/0day-ci/archive/20230721/202307210951.NCdscoSS-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202307210951.NCdscoSS-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
>     In file included from mm/page_io.c:15:
>     In file included from include/linux/kernel_stat.h:9:
>     In file included from include/linux/interrupt.h:11:
>     In file included from include/linux/hardirq.h:11:
>     In file included from arch/um/include/asm/hardirq.h:5:
>     In file included from include/asm-generic/hardirq.h:17:
>     In file included from include/linux/irq.h:20:
>     In file included from include/linux/io.h:13:
>     In file included from arch/um/include/asm/io.h:24:
>     include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       547 |         val = __raw_readb(PCI_IOBASE + addr);
>           |                           ~~~~~~~~~~ ^
>     include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
>           |                                                         ~~~~~~~~~~ ^
>     include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
>        37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
>           |                                                   ^
>     In file included from mm/page_io.c:15:
>     In file included from include/linux/kernel_stat.h:9:
>     In file included from include/linux/interrupt.h:11:
>     In file included from include/linux/hardirq.h:11:
>     In file included from arch/um/include/asm/hardirq.h:5:
>     In file included from include/asm-generic/hardirq.h:17:
>     In file included from include/linux/irq.h:20:
>     In file included from include/linux/io.h:13:
>     In file included from arch/um/include/asm/io.h:24:
>     include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
>           |                                                         ~~~~~~~~~~ ^
>     include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
>        35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
>           |                                                   ^
>     In file included from mm/page_io.c:15:
>     In file included from include/linux/kernel_stat.h:9:
>     In file included from include/linux/interrupt.h:11:
>     In file included from include/linux/hardirq.h:11:
>     In file included from arch/um/include/asm/hardirq.h:5:
>     In file included from include/asm-generic/hardirq.h:17:
>     In file included from include/linux/irq.h:20:
>     In file included from include/linux/io.h:13:
>     In file included from arch/um/include/asm/io.h:24:
>     include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       584 |         __raw_writeb(value, PCI_IOBASE + addr);
>           |                             ~~~~~~~~~~ ^
>     include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
>           |                                                       ~~~~~~~~~~ ^
>     include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
>           |                                                       ~~~~~~~~~~ ^
>     include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       692 |         readsb(PCI_IOBASE + addr, buffer, count);
>           |                ~~~~~~~~~~ ^
>     include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       700 |         readsw(PCI_IOBASE + addr, buffer, count);
>           |                ~~~~~~~~~~ ^
>     include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       708 |         readsl(PCI_IOBASE + addr, buffer, count);
>           |                ~~~~~~~~~~ ^
>     include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       717 |         writesb(PCI_IOBASE + addr, buffer, count);
>           |                 ~~~~~~~~~~ ^
>     include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       726 |         writesw(PCI_IOBASE + addr, buffer, count);
>           |                 ~~~~~~~~~~ ^
>     include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
>       735 |         writesl(PCI_IOBASE + addr, buffer, count);
>           |                 ~~~~~~~~~~ ^
>>> mm/page_io.c:211:18: error: use of undeclared identifier 'THP_SWPOUT'; did you mean 'PSWPOUT'?
>       211 |                 count_vm_event(THP_SWPOUT);
>           |                                ^~~~~~~~~~
>           |                                PSWPOUT
>     include/linux/vm_event_item.h:32:47: note: 'PSWPOUT' declared here
>        32 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
>           |                                               ^
>     12 warnings and 1 error generated.

I will fix it in the next version. Thanks.

>
> vim +211 mm/page_io.c
>
> 2f772e6cadf8ad Seth Jennings 2013-04-29  207
> c40c44eb86eb74 ZhangPeng     2023-07-20  208  static inline void count_swpout_vm_event(struct folio *folio)
> 225311a46411c3 Huang Ying    2017-09-06  209  {
> c40c44eb86eb74 ZhangPeng     2023-07-20  210  	if (unlikely(folio_test_pmd_mappable(folio)))
> 225311a46411c3 Huang Ying    2017-09-06 @211  		count_vm_event(THP_SWPOUT);
> c40c44eb86eb74 ZhangPeng     2023-07-20  212  	count_vm_events(PSWPOUT, folio_nr_pages(folio));
> 225311a46411c3 Huang Ying    2017-09-06  213  }
> 225311a46411c3 Huang Ying    2017-09-06  214
>
-- 
Best Regards,
Peng


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-07-21  2:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20 13:01 [PATCH v3 00/10] Convert several functions in page_io.c to use a folio Peng Zhang
2023-07-20 13:01 ` [PATCH v3 01/10] mm/page_io: remove unneeded ClearPageUptodate() Peng Zhang
2023-07-20 13:01 ` [PATCH v3 02/10] mm/page_io: remove unneeded SetPageError() Peng Zhang
2023-07-20 13:01 ` [PATCH v3 03/10] mm/page_io: introduce bio_first_folio_all() Peng Zhang
2023-07-20 13:01 ` [PATCH v3 04/10] mm/page_io: use a folio in __end_swap_bio_write() Peng Zhang
2023-07-20 13:01 ` [PATCH v3 05/10] mm/page_io: use a folio in __end_swap_bio_read() Peng Zhang
2023-07-20 13:01 ` [PATCH v3 06/10] mm/page_io: use a folio in sio_read_complete() Peng Zhang
2023-07-20 13:01 ` [PATCH v3 07/10] mm/page_io: use a folio in swap_writepage_bdev_sync() Peng Zhang
2023-07-20 13:01 ` [PATCH v3 08/10] mm/page_io: use a folio in swap_writepage_bdev_async() Peng Zhang
2023-07-20 13:01 ` [PATCH v3 09/10] mm/page_io: convert count_swpout_vm_event() to take in a folio Peng Zhang
2023-07-21  1:31   ` kernel test robot
2023-07-21  2:30     ` zhangpeng (AS)
2023-07-21  2:02   ` kernel test robot
2023-07-20 13:01 ` [PATCH v3 10/10] mm/page_io: convert bio_associate_blkg_from_page() " Peng Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.