linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* improve pagecache PSI annotations
@ 2022-09-10  6:50 Christoph Hellwig
  2022-09-10  6:50 ` [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Christoph Hellwig
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-10  6:50 UTC (permalink / raw)
  To: Jens Axboe, Matthew Wilcox, Johannes Weiner, Suren Baghdasaryan,
	Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

Hi all,

currently the VM tries to abuse the block layer submission path for
the page cache PSI annotations.  This series instead annotates the
->read_folio and ->readahead calls in the core VM code, and then
only deals with the odd direct add_to_page_cache_lru calls manually.

Diffstat:
 block/bio.c               |    8 --------
 block/blk-core.c          |   17 -----------------
 fs/btrfs/compression.c    |   14 ++++++++++++--
 fs/direct-io.c            |    2 --
 fs/erofs/zdata.c          |   13 ++++++++++++-
 include/linux/blk_types.h |    1 -
 include/linux/pagemap.h   |    2 ++
 kernel/sched/psi.c        |    2 ++
 mm/filemap.c              |    7 +++++++
 mm/readahead.c            |   22 ++++++++++++++++++----
 10 files changed, 53 insertions(+), 35 deletions(-)

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

* [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls
  2022-09-10  6:50 improve pagecache PSI annotations Christoph Hellwig
@ 2022-09-10  6:50 ` Christoph Hellwig
  2022-09-10 11:34   ` Jens Axboe
                     ` (2 more replies)
  2022-09-10  6:50 ` [PATCH 2/5] sched/psi: export psi_memstall_{enter,leave} Christoph Hellwig
                   ` (4 subsequent siblings)
  5 siblings, 3 replies; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-10  6:50 UTC (permalink / raw)
  To: Jens Axboe, Matthew Wilcox, Johannes Weiner, Suren Baghdasaryan,
	Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

PSI tries to account for the cost of bringing back in pages discarded by
the MM LRU management.  Currently the prime place for that is hooked into
the bio submission path, which is a rather bad place:

 - it does not actually account I/O for non-block file systems, of which
   we have many
 - it adds overhead and a layering violation to the block layer

Add the accounting into the two places in the core MM code that read
pages into an address space by calling into ->read_folio and ->readahead
so that the entire file system operations are covered, to broaden
the coverage and allow removing the accounting in the block layer going
forward.

As psi_memstall_enter can deal with nested calls this will not lead to
double accounting even while the bio annotations are still present.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/pagemap.h |  2 ++
 mm/filemap.c            |  7 +++++++
 mm/readahead.c          | 22 ++++++++++++++++++----
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 0178b2040ea38..201dc7281640b 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -1173,6 +1173,8 @@ struct readahead_control {
 	pgoff_t _index;
 	unsigned int _nr_pages;
 	unsigned int _batch_count;
+	bool _workingset;
+	unsigned long _pflags;
 };
 
 #define DEFINE_READAHEAD(ractl, f, r, m, i)				\
diff --git a/mm/filemap.c b/mm/filemap.c
index 15800334147b3..c943d1b90cc26 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2382,6 +2382,8 @@ static void filemap_get_read_batch(struct address_space *mapping,
 static int filemap_read_folio(struct file *file, filler_t filler,
 		struct folio *folio)
 {
+	bool workingset = folio_test_workingset(folio);
+	unsigned long pflags;
 	int error;
 
 	/*
@@ -2390,8 +2392,13 @@ static int filemap_read_folio(struct file *file, filler_t filler,
 	 * fails.
 	 */
 	folio_clear_error(folio);
+
 	/* Start the actual read. The read will unlock the page. */
+	if (unlikely(workingset))
+		psi_memstall_enter(&pflags);
 	error = filler(file, folio);
+	if (unlikely(workingset))
+		psi_memstall_leave(&pflags);
 	if (error)
 		return error;
 
diff --git a/mm/readahead.c b/mm/readahead.c
index fdcd28cbd92de..43631c146d6dc 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -122,6 +122,7 @@
 #include <linux/task_io_accounting_ops.h>
 #include <linux/pagevec.h>
 #include <linux/pagemap.h>
+#include <linux/psi.h>
 #include <linux/syscalls.h>
 #include <linux/file.h>
 #include <linux/mm_inline.h>
@@ -152,6 +153,8 @@ static void read_pages(struct readahead_control *rac)
 	if (!readahead_count(rac))
 		return;
 
+	if (unlikely(rac->_workingset))
+		psi_memstall_enter(&rac->_pflags);
 	blk_start_plug(&plug);
 
 	if (aops->readahead) {
@@ -179,6 +182,9 @@ static void read_pages(struct readahead_control *rac)
 	}
 
 	blk_finish_plug(&plug);
+	if (unlikely(rac->_workingset))
+		psi_memstall_leave(&rac->_pflags);
+	rac->_workingset = false;
 
 	BUG_ON(readahead_count(rac));
 }
@@ -252,6 +258,7 @@ void page_cache_ra_unbounded(struct readahead_control *ractl,
 		}
 		if (i == nr_to_read - lookahead_size)
 			folio_set_readahead(folio);
+		ractl->_workingset |= folio_test_workingset(folio);
 		ractl->_nr_pages++;
 	}
 
@@ -480,11 +487,14 @@ static inline int ra_alloc_folio(struct readahead_control *ractl, pgoff_t index,
 	if (index == mark)
 		folio_set_readahead(folio);
 	err = filemap_add_folio(ractl->mapping, folio, index, gfp);
-	if (err)
+	if (err) {
 		folio_put(folio);
-	else
-		ractl->_nr_pages += 1UL << order;
-	return err;
+		return err;
+	}
+
+	ractl->_nr_pages += 1UL << order;
+	ractl->_workingset = folio_test_workingset(folio);
+	return 0;
 }
 
 void page_cache_ra_order(struct readahead_control *ractl,
@@ -826,6 +836,10 @@ void readahead_expand(struct readahead_control *ractl,
 			put_page(page);
 			return;
 		}
+		if (unlikely(PageWorkingset(page)) && !ractl->_workingset) {
+			ractl->_workingset = true;
+			psi_memstall_enter(&ractl->_pflags);
+		}
 		ractl->_nr_pages++;
 		if (ra) {
 			ra->size++;
-- 
2.30.2


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

* [PATCH 2/5] sched/psi: export psi_memstall_{enter,leave}
  2022-09-10  6:50 improve pagecache PSI annotations Christoph Hellwig
  2022-09-10  6:50 ` [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Christoph Hellwig
@ 2022-09-10  6:50 ` Christoph Hellwig
  2022-09-14 11:42   ` Johannes Weiner
  2022-09-10  6:50 ` [PATCH 3/5] btrfs: add manual PSI accounting for compressed reads Christoph Hellwig
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-10  6:50 UTC (permalink / raw)
  To: Jens Axboe, Matthew Wilcox, Johannes Weiner, Suren Baghdasaryan,
	Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

To properly account for all refaults from file system logic, file systems
need to call psi_memstall_enter directly, so export it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 kernel/sched/psi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index ecb4b4ff4ce0a..7f6030091aeee 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -917,6 +917,7 @@ void psi_memstall_enter(unsigned long *flags)
 
 	rq_unlock_irq(rq, &rf);
 }
+EXPORT_SYMBOL_GPL(psi_memstall_enter);
 
 /**
  * psi_memstall_leave - mark the end of an memory stall section
@@ -946,6 +947,7 @@ void psi_memstall_leave(unsigned long *flags)
 
 	rq_unlock_irq(rq, &rf);
 }
+EXPORT_SYMBOL_GPL(psi_memstall_leave);
 
 #ifdef CONFIG_CGROUPS
 int psi_cgroup_alloc(struct cgroup *cgroup)
-- 
2.30.2


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

* [PATCH 3/5] btrfs: add manual PSI accounting for compressed reads
  2022-09-10  6:50 improve pagecache PSI annotations Christoph Hellwig
  2022-09-10  6:50 ` [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Christoph Hellwig
  2022-09-10  6:50 ` [PATCH 2/5] sched/psi: export psi_memstall_{enter,leave} Christoph Hellwig
@ 2022-09-10  6:50 ` Christoph Hellwig
  2022-09-12 15:28   ` David Sterba
  2022-09-14 11:46   ` Johannes Weiner
  2022-09-10  6:50 ` [PATCH 4/5] erofs: add manual PSI accounting for the compressed address space Christoph Hellwig
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-10  6:50 UTC (permalink / raw)
  To: Jens Axboe, Matthew Wilcox, Johannes Weiner, Suren Baghdasaryan,
	Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

btrfs compressed reads try to always read the entire compressed chunk,
even if only a subset is requested.  Currently this is covered by the
magic PSI accounting underneath submit_bio, but that is about to go
away. Instead add manual psi_memstall_{enter,leave} annotations.

Note that for readahead this really should be using readahead_expand,
but the additionals reads are also done for plain ->read_folio where
readahead_expand can't work, so this overall logic is left as-is for
now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/btrfs/compression.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index e84d22c5c6a83..f7889a00e0055 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -15,6 +15,7 @@
 #include <linux/string.h>
 #include <linux/backing-dev.h>
 #include <linux/writeback.h>
+#include <linux/psi.h>
 #include <linux/slab.h>
 #include <linux/sched/mm.h>
 #include <linux/log2.h>
@@ -519,7 +520,8 @@ static u64 bio_end_offset(struct bio *bio)
  */
 static noinline int add_ra_bio_pages(struct inode *inode,
 				     u64 compressed_end,
-				     struct compressed_bio *cb)
+				     struct compressed_bio *cb,
+				     unsigned long *pflags)
 {
 	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
 	unsigned long end_index;
@@ -588,6 +590,9 @@ static noinline int add_ra_bio_pages(struct inode *inode,
 			continue;
 		}
 
+		if (unlikely(PageWorkingset(page)))
+			psi_memstall_enter(pflags);
+
 		ret = set_page_extent_mapped(page);
 		if (ret < 0) {
 			unlock_page(page);
@@ -674,6 +679,8 @@ void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
 	u64 em_len;
 	u64 em_start;
 	struct extent_map *em;
+	/* initialize to 1 to make skip psi_memstall_leave unless needed */
+	unsigned long pflags = 1;
 	blk_status_t ret;
 	int ret2;
 	int i;
@@ -729,7 +736,7 @@ void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
 		goto fail;
 	}
 
-	add_ra_bio_pages(inode, em_start + em_len, cb);
+	add_ra_bio_pages(inode, em_start + em_len, cb, &pflags);
 
 	/* include any pages we added in add_ra-bio_pages */
 	cb->len = bio->bi_iter.bi_size;
@@ -810,6 +817,9 @@ void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
 		}
 	}
 
+	if (!pflags)
+		psi_memstall_leave(&pflags);
+
 	if (refcount_dec_and_test(&cb->pending_ios))
 		finish_compressed_bio_read(cb);
 	return;
-- 
2.30.2


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

* [PATCH 4/5] erofs: add manual PSI accounting for the compressed address space
  2022-09-10  6:50 improve pagecache PSI annotations Christoph Hellwig
                   ` (2 preceding siblings ...)
  2022-09-10  6:50 ` [PATCH 3/5] btrfs: add manual PSI accounting for compressed reads Christoph Hellwig
@ 2022-09-10  6:50 ` Christoph Hellwig
  2022-09-14 11:47   ` Johannes Weiner
  2022-09-14 12:47   ` Gao Xiang
  2022-09-10  6:50 ` [PATCH 5/5] block: remove PSI accounting from the bio layer Christoph Hellwig
  2022-09-10 11:32 ` improve pagecache PSI annotations Jens Axboe
  5 siblings, 2 replies; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-10  6:50 UTC (permalink / raw)
  To: Jens Axboe, Matthew Wilcox, Johannes Weiner, Suren Baghdasaryan,
	Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

erofs uses an additional address space for compressed data read from disk
in addition to the one directly associated with the inode.  Reading into
the lower address space is open coded using add_to_page_cache_lru instead
of using the filemap.c helper for page allocation micro-optimizations,
which means it is not covered by the MM PSI annotations for ->read_folio
and ->readahead, so add manual ones instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/erofs/zdata.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 5792ca9e0d5ef..143a101a36887 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -7,6 +7,7 @@
 #include "zdata.h"
 #include "compress.h"
 #include <linux/prefetch.h>
+#include <linux/psi.h>
 
 #include <trace/events/erofs.h>
 
@@ -1365,6 +1366,8 @@ static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f,
 	struct block_device *last_bdev;
 	unsigned int nr_bios = 0;
 	struct bio *bio = NULL;
+	/* initialize to 1 to make skip psi_memstall_leave unless needed */
+	unsigned long pflags = 1;
 
 	bi_private = jobqueueset_init(sb, q, fgq, force_fg);
 	qtail[JQ_BYPASS] = &q[JQ_BYPASS]->head;
@@ -1414,10 +1417,15 @@ static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f,
 			if (bio && (cur != last_index + 1 ||
 				    last_bdev != mdev.m_bdev)) {
 submit_bio_retry:
+				if (!pflags)
+					psi_memstall_leave(&pflags);
 				submit_bio(bio);
 				bio = NULL;
 			}
 
+			if (unlikely(PageWorkingset(page)))
+				psi_memstall_enter(&pflags);
+
 			if (!bio) {
 				bio = bio_alloc(mdev.m_bdev, BIO_MAX_VECS,
 						REQ_OP_READ, GFP_NOIO);
@@ -1445,8 +1453,11 @@ static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f,
 			move_to_bypass_jobqueue(pcl, qtail, owned_head);
 	} while (owned_head != Z_EROFS_PCLUSTER_TAIL);
 
-	if (bio)
+	if (bio) {
+		if (!pflags)
+			psi_memstall_leave(&pflags);
 		submit_bio(bio);
+	}
 
 	/*
 	 * although background is preferred, no one is pending for submission.
-- 
2.30.2


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

* [PATCH 5/5] block: remove PSI accounting from the bio layer
  2022-09-10  6:50 improve pagecache PSI annotations Christoph Hellwig
                   ` (3 preceding siblings ...)
  2022-09-10  6:50 ` [PATCH 4/5] erofs: add manual PSI accounting for the compressed address space Christoph Hellwig
@ 2022-09-10  6:50 ` Christoph Hellwig
  2022-09-14 11:48   ` Johannes Weiner
  2022-09-10 11:32 ` improve pagecache PSI annotations Jens Axboe
  5 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-10  6:50 UTC (permalink / raw)
  To: Jens Axboe, Matthew Wilcox, Johannes Weiner, Suren Baghdasaryan,
	Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

PSI accounting is now done by the VM code, where it should have been
since the beginning.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/bio.c               |  8 --------
 block/blk-core.c          | 17 -----------------
 fs/direct-io.c            |  2 --
 include/linux/blk_types.h |  1 -
 4 files changed, 28 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index 3d3a2678fea25..d10c4e888cdcf 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1065,9 +1065,6 @@ void __bio_add_page(struct bio *bio, struct page *page,
 
 	bio->bi_iter.bi_size += len;
 	bio->bi_vcnt++;
-
-	if (!bio_flagged(bio, BIO_WORKINGSET) && unlikely(PageWorkingset(page)))
-		bio_set_flag(bio, BIO_WORKINGSET);
 }
 EXPORT_SYMBOL_GPL(__bio_add_page);
 
@@ -1276,9 +1273,6 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
  * fit into the bio, or are requested in @iter, whatever is smaller. If
  * MM encounters an error pinning the requested pages, it stops. Error
  * is returned only if 0 pages could be pinned.
- *
- * It's intended for direct IO, so doesn't do PSI tracking, the caller is
- * responsible for setting BIO_WORKINGSET if necessary.
  */
 int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
 {
@@ -1294,8 +1288,6 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
 		ret = __bio_iov_iter_get_pages(bio, iter);
 	} while (!ret && iov_iter_count(iter) && !bio_full(bio, 0));
 
-	/* don't account direct I/O as memory stall */
-	bio_clear_flag(bio, BIO_WORKINGSET);
 	return bio->bi_vcnt ? 0 : ret;
 }
 EXPORT_SYMBOL_GPL(bio_iov_iter_get_pages);
diff --git a/block/blk-core.c b/block/blk-core.c
index a0d1104c5590c..9e19195af6f5b 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -37,7 +37,6 @@
 #include <linux/t10-pi.h>
 #include <linux/debugfs.h>
 #include <linux/bpf.h>
-#include <linux/psi.h>
 #include <linux/part_stat.h>
 #include <linux/sched/sysctl.h>
 #include <linux/blk-crypto.h>
@@ -829,22 +828,6 @@ void submit_bio(struct bio *bio)
 		count_vm_events(PGPGOUT, bio_sectors(bio));
 	}
 
-	/*
-	 * If we're reading data that is part of the userspace workingset, count
-	 * submission time as memory stall.  When the device is congested, or
-	 * the submitting cgroup IO-throttled, submission can be a significant
-	 * part of overall IO time.
-	 */
-	if (unlikely(bio_op(bio) == REQ_OP_READ &&
-	    bio_flagged(bio, BIO_WORKINGSET))) {
-		unsigned long pflags;
-
-		psi_memstall_enter(&pflags);
-		submit_bio_noacct(bio);
-		psi_memstall_leave(&pflags);
-		return;
-	}
-
 	submit_bio_noacct(bio);
 }
 EXPORT_SYMBOL(submit_bio);
diff --git a/fs/direct-io.c b/fs/direct-io.c
index f669163d5860f..03d381377ae10 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -421,8 +421,6 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio)
 	unsigned long flags;
 
 	bio->bi_private = dio;
-	/* don't account direct I/O as memory stall */
-	bio_clear_flag(bio, BIO_WORKINGSET);
 
 	spin_lock_irqsave(&dio->bio_lock, flags);
 	dio->refcount++;
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 1ef99790f6ed3..8b1858df21752 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -321,7 +321,6 @@ enum {
 	BIO_NO_PAGE_REF,	/* don't put release vec pages */
 	BIO_CLONED,		/* doesn't own data */
 	BIO_BOUNCED,		/* bio is a bounce bio */
-	BIO_WORKINGSET,		/* contains userspace workingset pages */
 	BIO_QUIET,		/* Make BIO Quiet */
 	BIO_CHAIN,		/* chained bio, ->bi_remaining in effect */
 	BIO_REFFED,		/* bio has elevated ->bi_cnt */
-- 
2.30.2


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

* Re: improve pagecache PSI annotations
  2022-09-10  6:50 improve pagecache PSI annotations Christoph Hellwig
                   ` (4 preceding siblings ...)
  2022-09-10  6:50 ` [PATCH 5/5] block: remove PSI accounting from the bio layer Christoph Hellwig
@ 2022-09-10 11:32 ` Jens Axboe
  5 siblings, 0 replies; 19+ messages in thread
From: Jens Axboe @ 2022-09-10 11:32 UTC (permalink / raw)
  To: Christoph Hellwig, Matthew Wilcox, Johannes Weiner,
	Suren Baghdasaryan, Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

On 9/10/22 12:50 AM, Christoph Hellwig wrote:
> Hi all,
> 
> currently the VM tries to abuse the block layer submission path for
> the page cache PSI annotations.  This series instead annotates the
> ->read_folio and ->readahead calls in the core VM code, and then
> only deals with the odd direct add_to_page_cache_lru calls manually.
> 
> Diffstat:
>  block/bio.c               |    8 --------
>  block/blk-core.c          |   17 -----------------
>  fs/btrfs/compression.c    |   14 ++++++++++++--
>  fs/direct-io.c            |    2 --
>  fs/erofs/zdata.c          |   13 ++++++++++++-
>  include/linux/blk_types.h |    1 -
>  include/linux/pagemap.h   |    2 ++
>  kernel/sched/psi.c        |    2 ++
>  mm/filemap.c              |    7 +++++++
>  mm/readahead.c            |   22 ++++++++++++++++++----
>  10 files changed, 53 insertions(+), 35 deletions(-)

Nice! It's always bothered me that we have this weird layering
here.

-- 
Jens Axboe



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

* Re: [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls
  2022-09-10  6:50 ` [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Christoph Hellwig
@ 2022-09-10 11:34   ` Jens Axboe
  2022-09-12  8:35     ` Christoph Hellwig
  2022-09-10 18:26   ` Matthew Wilcox
  2022-09-14 11:41   ` Johannes Weiner
  2 siblings, 1 reply; 19+ messages in thread
From: Jens Axboe @ 2022-09-10 11:34 UTC (permalink / raw)
  To: Christoph Hellwig, Matthew Wilcox, Johannes Weiner,
	Suren Baghdasaryan, Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

On 9/10/22 12:50 AM, Christoph Hellwig wrote:
> @@ -2390,8 +2392,13 @@ static int filemap_read_folio(struct file *file, filler_t filler,
>  	 * fails.
>  	 */
>  	folio_clear_error(folio);
> +
>  	/* Start the actual read. The read will unlock the page. */
> +	if (unlikely(workingset))
> +		psi_memstall_enter(&pflags);
>  	error = filler(file, folio);
> +	if (unlikely(workingset))
> +		psi_memstall_leave(&pflags);
>  	if (error)
>  		return error;

I think this would read better as:

  	/* Start the actual read. The read will unlock the page. */
	if (unlikely(workingset)) {
		psi_memstall_enter(&pflags);
		error = filler(file, folio);
		psi_memstall_leave(&pflags);
	} else {
		error = filler(file, folio);
	}
  	if (error)
  		return error;

-- 
Jens Axboe

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

* Re: [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls
  2022-09-10  6:50 ` [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Christoph Hellwig
  2022-09-10 11:34   ` Jens Axboe
@ 2022-09-10 18:26   ` Matthew Wilcox
  2022-09-12  8:33     ` Christoph Hellwig
  2022-09-14 11:41   ` Johannes Weiner
  2 siblings, 1 reply; 19+ messages in thread
From: Matthew Wilcox @ 2022-09-10 18:26 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-mm, linux-erofs, Josef Bacik, linux-block,
	Chris Mason, Johannes Weiner, David Sterba, linux-fsdevel,
	Andrew Morton, Suren Baghdasaryan, linux-btrfs

On Sat, Sep 10, 2022 at 08:50:54AM +0200, Christoph Hellwig wrote:
> @@ -480,11 +487,14 @@ static inline int ra_alloc_folio(struct readahead_control *ractl, pgoff_t index,
>  	if (index == mark)
>  		folio_set_readahead(folio);
>  	err = filemap_add_folio(ractl->mapping, folio, index, gfp);
> -	if (err)
> +	if (err) {
>  		folio_put(folio);
> -	else
> -		ractl->_nr_pages += 1UL << order;
> -	return err;
> +		return err;
> +	}
> +
> +	ractl->_nr_pages += 1UL << order;
> +	ractl->_workingset = folio_test_workingset(folio);

I don't have time to look at this properly right now (about to catch a
bus to the plane), but I think this should be |=, not =?


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

* Re: [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls
  2022-09-10 18:26   ` Matthew Wilcox
@ 2022-09-12  8:33     ` Christoph Hellwig
  0 siblings, 0 replies; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-12  8:33 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Jens Axboe, linux-mm, linux-erofs, Josef Bacik, linux-block,
	Chris Mason, Johannes Weiner, David Sterba, linux-fsdevel,
	Andrew Morton, Suren Baghdasaryan, Christoph Hellwig,
	linux-btrfs

On Sat, Sep 10, 2022 at 07:26:35PM +0100, Matthew Wilcox wrote:
> I don't have time to look at this properly right now (about to catch a
> bus to the plane), but I think this should be |=, not =?

Yes.

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

* Re: [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls
  2022-09-10 11:34   ` Jens Axboe
@ 2022-09-12  8:35     ` Christoph Hellwig
  0 siblings, 0 replies; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-12  8:35 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-mm, linux-erofs, Josef Bacik, Matthew Wilcox, linux-block,
	Chris Mason, Johannes Weiner, David Sterba, linux-fsdevel,
	Andrew Morton, Suren Baghdasaryan, Christoph Hellwig,
	linux-btrfs

On Sat, Sep 10, 2022 at 05:34:02AM -0600, Jens Axboe wrote:
> >  	/* Start the actual read. The read will unlock the page. */
> > +	if (unlikely(workingset))
> > +		psi_memstall_enter(&pflags);
> >  	error = filler(file, folio);
> > +	if (unlikely(workingset))
> > +		psi_memstall_leave(&pflags);
> >  	if (error)
> >  		return error;
> 
> I think this would read better as:
> 
>   	/* Start the actual read. The read will unlock the page. */
> 	if (unlikely(workingset)) {
> 		psi_memstall_enter(&pflags);
> 		error = filler(file, folio);
> 		psi_memstall_leave(&pflags);
> 	} else {
> 		error = filler(file, folio);
> 	}
>   	if (error)
>   		return error;

I had it both ways.  For any non-trivial code in the conditionals I
tend to go with your version all the time.  But for two times a single
lines both variants tends to suck, so I can live with either one.

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

* Re: [PATCH 3/5] btrfs: add manual PSI accounting for compressed reads
  2022-09-10  6:50 ` [PATCH 3/5] btrfs: add manual PSI accounting for compressed reads Christoph Hellwig
@ 2022-09-12 15:28   ` David Sterba
  2022-09-14 11:46   ` Johannes Weiner
  1 sibling, 0 replies; 19+ messages in thread
From: David Sterba @ 2022-09-12 15:28 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-mm, linux-erofs, Josef Bacik, Matthew Wilcox,
	linux-block, Chris Mason, Johannes Weiner, David Sterba,
	linux-fsdevel, Andrew Morton, Suren Baghdasaryan, linux-btrfs

On Sat, Sep 10, 2022 at 08:50:56AM +0200, Christoph Hellwig wrote:
> btrfs compressed reads try to always read the entire compressed chunk,
> even if only a subset is requested.  Currently this is covered by the
> magic PSI accounting underneath submit_bio, but that is about to go
> away. Instead add manual psi_memstall_{enter,leave} annotations.
> 
> Note that for readahead this really should be using readahead_expand,
> but the additionals reads are also done for plain ->read_folio where
> readahead_expand can't work, so this overall logic is left as-is for
> now.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

With some small fixups,

Acked-by: David Sterba <dsterba@suse.com>

>  fs/btrfs/compression.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index e84d22c5c6a83..f7889a00e0055 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -15,6 +15,7 @@
>  #include <linux/string.h>
>  #include <linux/backing-dev.h>
>  #include <linux/writeback.h>
> +#include <linux/psi.h>
>  #include <linux/slab.h>
>  #include <linux/sched/mm.h>
>  #include <linux/log2.h>
> @@ -519,7 +520,8 @@ static u64 bio_end_offset(struct bio *bio)
>   */
>  static noinline int add_ra_bio_pages(struct inode *inode,
>  				     u64 compressed_end,
> -				     struct compressed_bio *cb)
> +				     struct compressed_bio *cb,
> +				     unsigned long *pflags)
>  {
>  	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
>  	unsigned long end_index;
> @@ -588,6 +590,9 @@ static noinline int add_ra_bio_pages(struct inode *inode,
>  			continue;
>  		}
>  
> +		if (unlikely(PageWorkingset(page)))

Please drop the 'unlikely', in this case it does not seem to make much
sense.

> +			psi_memstall_enter(pflags);
> +
>  		ret = set_page_extent_mapped(page);
>  		if (ret < 0) {
>  			unlock_page(page);
> @@ -674,6 +679,8 @@ void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
>  	u64 em_len;
>  	u64 em_start;
>  	struct extent_map *em;
> +	/* initialize to 1 to make skip psi_memstall_leave unless needed */

First letter in comment should be upper case unless it's an identifier.

> +	unsigned long pflags = 1;
>  	blk_status_t ret;
>  	int ret2;
>  	int i;
> @@ -729,7 +736,7 @@ void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
>  		goto fail;
>  	}
>  
> -	add_ra_bio_pages(inode, em_start + em_len, cb);
> +	add_ra_bio_pages(inode, em_start + em_len, cb, &pflags);
>  
>  	/* include any pages we added in add_ra-bio_pages */
>  	cb->len = bio->bi_iter.bi_size;
> @@ -810,6 +817,9 @@ void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
>  		}
>  	}
>  
> +	if (!pflags)
> +		psi_memstall_leave(&pflags);
> +
>  	if (refcount_dec_and_test(&cb->pending_ios))
>  		finish_compressed_bio_read(cb);
>  	return;
> -- 
> 2.30.2
> 

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

* Re: [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls
  2022-09-10  6:50 ` [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Christoph Hellwig
  2022-09-10 11:34   ` Jens Axboe
  2022-09-10 18:26   ` Matthew Wilcox
@ 2022-09-14 11:41   ` Johannes Weiner
  2 siblings, 0 replies; 19+ messages in thread
From: Johannes Weiner @ 2022-09-14 11:41 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-mm, linux-erofs, Josef Bacik, Matthew Wilcox,
	linux-block, Chris Mason, David Sterba, linux-fsdevel,
	Andrew Morton, Suren Baghdasaryan, linux-btrfs

On Sat, Sep 10, 2022 at 08:50:54AM +0200, Christoph Hellwig wrote:
> PSI tries to account for the cost of bringing back in pages discarded by
> the MM LRU management.  Currently the prime place for that is hooked into
> the bio submission path, which is a rather bad place:
> 
>  - it does not actually account I/O for non-block file systems, of which
>    we have many
>  - it adds overhead and a layering violation to the block layer
> 
> Add the accounting into the two places in the core MM code that read
> pages into an address space by calling into ->read_folio and ->readahead
> so that the entire file system operations are covered, to broaden
> the coverage and allow removing the accounting in the block layer going
> forward.
> 
> As psi_memstall_enter can deal with nested calls this will not lead to
> double accounting even while the bio annotations are still present.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

This is much cleaner. With the fixlet Willy pointed out:

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

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

* Re: [PATCH 2/5] sched/psi: export psi_memstall_{enter,leave}
  2022-09-10  6:50 ` [PATCH 2/5] sched/psi: export psi_memstall_{enter,leave} Christoph Hellwig
@ 2022-09-14 11:42   ` Johannes Weiner
  0 siblings, 0 replies; 19+ messages in thread
From: Johannes Weiner @ 2022-09-14 11:42 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-mm, linux-erofs, Josef Bacik, Matthew Wilcox,
	linux-block, Chris Mason, David Sterba, linux-fsdevel,
	Andrew Morton, Suren Baghdasaryan, linux-btrfs

On Sat, Sep 10, 2022 at 08:50:55AM +0200, Christoph Hellwig wrote:
> To properly account for all refaults from file system logic, file systems
> need to call psi_memstall_enter directly, so export it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

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

* Re: [PATCH 3/5] btrfs: add manual PSI accounting for compressed reads
  2022-09-10  6:50 ` [PATCH 3/5] btrfs: add manual PSI accounting for compressed reads Christoph Hellwig
  2022-09-12 15:28   ` David Sterba
@ 2022-09-14 11:46   ` Johannes Weiner
  1 sibling, 0 replies; 19+ messages in thread
From: Johannes Weiner @ 2022-09-14 11:46 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-mm, linux-erofs, Josef Bacik, Matthew Wilcox,
	linux-block, Chris Mason, David Sterba, linux-fsdevel,
	Andrew Morton, Suren Baghdasaryan, linux-btrfs

On Sat, Sep 10, 2022 at 08:50:56AM +0200, Christoph Hellwig wrote:
> btrfs compressed reads try to always read the entire compressed chunk,
> even if only a subset is requested.  Currently this is covered by the
> magic PSI accounting underneath submit_bio, but that is about to go
> away. Instead add manual psi_memstall_{enter,leave} annotations.
> 
> Note that for readahead this really should be using readahead_expand,
> but the additionals reads are also done for plain ->read_folio where
> readahead_expand can't work, so this overall logic is left as-is for
> now.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

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

* Re: [PATCH 4/5] erofs: add manual PSI accounting for the compressed address space
  2022-09-10  6:50 ` [PATCH 4/5] erofs: add manual PSI accounting for the compressed address space Christoph Hellwig
@ 2022-09-14 11:47   ` Johannes Weiner
  2022-09-14 12:47   ` Gao Xiang
  1 sibling, 0 replies; 19+ messages in thread
From: Johannes Weiner @ 2022-09-14 11:47 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-mm, linux-erofs, Josef Bacik, Matthew Wilcox,
	linux-block, Chris Mason, David Sterba, linux-fsdevel,
	Andrew Morton, Suren Baghdasaryan, linux-btrfs

On Sat, Sep 10, 2022 at 08:50:57AM +0200, Christoph Hellwig wrote:
> erofs uses an additional address space for compressed data read from disk
> in addition to the one directly associated with the inode.  Reading into
> the lower address space is open coded using add_to_page_cache_lru instead
> of using the filemap.c helper for page allocation micro-optimizations,
> which means it is not covered by the MM PSI annotations for ->read_folio
> and ->readahead, so add manual ones instead.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

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

* Re: [PATCH 5/5] block: remove PSI accounting from the bio layer
  2022-09-10  6:50 ` [PATCH 5/5] block: remove PSI accounting from the bio layer Christoph Hellwig
@ 2022-09-14 11:48   ` Johannes Weiner
  0 siblings, 0 replies; 19+ messages in thread
From: Johannes Weiner @ 2022-09-14 11:48 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, linux-mm, linux-erofs, Josef Bacik, Matthew Wilcox,
	linux-block, Chris Mason, David Sterba, linux-fsdevel,
	Andrew Morton, Suren Baghdasaryan, linux-btrfs

On Sat, Sep 10, 2022 at 08:50:58AM +0200, Christoph Hellwig wrote:
> PSI accounting is now done by the VM code, where it should have been
> since the beginning.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Nice!

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

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

* Re: [PATCH 4/5] erofs: add manual PSI accounting for the compressed address space
  2022-09-10  6:50 ` [PATCH 4/5] erofs: add manual PSI accounting for the compressed address space Christoph Hellwig
  2022-09-14 11:47   ` Johannes Weiner
@ 2022-09-14 12:47   ` Gao Xiang
  1 sibling, 0 replies; 19+ messages in thread
From: Gao Xiang @ 2022-09-14 12:47 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jens Axboe, Chris Mason, linux-erofs, Josef Bacik,
	Matthew Wilcox, linux-block, linux-mm, Johannes Weiner,
	David Sterba, linux-fsdevel, Andrew Morton, Suren Baghdasaryan,
	linux-btrfs

On Sat, Sep 10, 2022 at 08:50:57AM +0200, Christoph Hellwig wrote:
> erofs uses an additional address space for compressed data read from disk
> in addition to the one directly associated with the inode.  Reading into
> the lower address space is open coded using add_to_page_cache_lru instead
> of using the filemap.c helper for page allocation micro-optimizations,
> which means it is not covered by the MM PSI annotations for ->read_folio
> and ->readahead, so add manual ones instead.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Thanks, Looks good to me (Although I don't have chance to seek more time
digging into PSI internal...)

Acked-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang,

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

* [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls
  2022-09-15  9:41 improve pagecache PSI annotations v2 Christoph Hellwig
@ 2022-09-15  9:41 ` Christoph Hellwig
  0 siblings, 0 replies; 19+ messages in thread
From: Christoph Hellwig @ 2022-09-15  9:41 UTC (permalink / raw)
  To: Jens Axboe, Matthew Wilcox, Johannes Weiner, Suren Baghdasaryan,
	Andrew Morton
  Cc: linux-mm, Josef Bacik, linux-block, Chris Mason, David Sterba,
	linux-fsdevel, linux-erofs, linux-btrfs

PSI tries to account for the cost of bringing back in pages discarded by
the MM LRU management.  Currently the prime place for that is hooked into
the bio submission path, which is a rather bad place:

 - it does not actually account I/O for non-block file systems, of which
   we have many
 - it adds overhead and a layering violation to the block layer

Add the accounting into the two places in the core MM code that read
pages into an address space by calling into ->read_folio and ->readahead
so that the entire file system operations are covered, to broaden
the coverage and allow removing the accounting in the block layer going
forward.

As psi_memstall_enter can deal with nested calls this will not lead to
double accounting even while the bio annotations are still present.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
---
 include/linux/pagemap.h |  2 ++
 mm/filemap.c            |  7 +++++++
 mm/readahead.c          | 22 ++++++++++++++++++----
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 0178b2040ea38..201dc7281640b 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -1173,6 +1173,8 @@ struct readahead_control {
 	pgoff_t _index;
 	unsigned int _nr_pages;
 	unsigned int _batch_count;
+	bool _workingset;
+	unsigned long _pflags;
 };
 
 #define DEFINE_READAHEAD(ractl, f, r, m, i)				\
diff --git a/mm/filemap.c b/mm/filemap.c
index 15800334147b3..c943d1b90cc26 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2382,6 +2382,8 @@ static void filemap_get_read_batch(struct address_space *mapping,
 static int filemap_read_folio(struct file *file, filler_t filler,
 		struct folio *folio)
 {
+	bool workingset = folio_test_workingset(folio);
+	unsigned long pflags;
 	int error;
 
 	/*
@@ -2390,8 +2392,13 @@ static int filemap_read_folio(struct file *file, filler_t filler,
 	 * fails.
 	 */
 	folio_clear_error(folio);
+
 	/* Start the actual read. The read will unlock the page. */
+	if (unlikely(workingset))
+		psi_memstall_enter(&pflags);
 	error = filler(file, folio);
+	if (unlikely(workingset))
+		psi_memstall_leave(&pflags);
 	if (error)
 		return error;
 
diff --git a/mm/readahead.c b/mm/readahead.c
index fdcd28cbd92de..b10f0cf81d804 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -122,6 +122,7 @@
 #include <linux/task_io_accounting_ops.h>
 #include <linux/pagevec.h>
 #include <linux/pagemap.h>
+#include <linux/psi.h>
 #include <linux/syscalls.h>
 #include <linux/file.h>
 #include <linux/mm_inline.h>
@@ -152,6 +153,8 @@ static void read_pages(struct readahead_control *rac)
 	if (!readahead_count(rac))
 		return;
 
+	if (unlikely(rac->_workingset))
+		psi_memstall_enter(&rac->_pflags);
 	blk_start_plug(&plug);
 
 	if (aops->readahead) {
@@ -179,6 +182,9 @@ static void read_pages(struct readahead_control *rac)
 	}
 
 	blk_finish_plug(&plug);
+	if (unlikely(rac->_workingset))
+		psi_memstall_leave(&rac->_pflags);
+	rac->_workingset = false;
 
 	BUG_ON(readahead_count(rac));
 }
@@ -252,6 +258,7 @@ void page_cache_ra_unbounded(struct readahead_control *ractl,
 		}
 		if (i == nr_to_read - lookahead_size)
 			folio_set_readahead(folio);
+		ractl->_workingset |= folio_test_workingset(folio);
 		ractl->_nr_pages++;
 	}
 
@@ -480,11 +487,14 @@ static inline int ra_alloc_folio(struct readahead_control *ractl, pgoff_t index,
 	if (index == mark)
 		folio_set_readahead(folio);
 	err = filemap_add_folio(ractl->mapping, folio, index, gfp);
-	if (err)
+	if (err) {
 		folio_put(folio);
-	else
-		ractl->_nr_pages += 1UL << order;
-	return err;
+		return err;
+	}
+
+	ractl->_nr_pages += 1UL << order;
+	ractl->_workingset |= folio_test_workingset(folio);
+	return 0;
 }
 
 void page_cache_ra_order(struct readahead_control *ractl,
@@ -826,6 +836,10 @@ void readahead_expand(struct readahead_control *ractl,
 			put_page(page);
 			return;
 		}
+		if (unlikely(PageWorkingset(page)) && !ractl->_workingset) {
+			ractl->_workingset = true;
+			psi_memstall_enter(&ractl->_pflags);
+		}
 		ractl->_nr_pages++;
 		if (ra) {
 			ra->size++;
-- 
2.30.2


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

end of thread, other threads:[~2022-09-15  9:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-10  6:50 improve pagecache PSI annotations Christoph Hellwig
2022-09-10  6:50 ` [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Christoph Hellwig
2022-09-10 11:34   ` Jens Axboe
2022-09-12  8:35     ` Christoph Hellwig
2022-09-10 18:26   ` Matthew Wilcox
2022-09-12  8:33     ` Christoph Hellwig
2022-09-14 11:41   ` Johannes Weiner
2022-09-10  6:50 ` [PATCH 2/5] sched/psi: export psi_memstall_{enter,leave} Christoph Hellwig
2022-09-14 11:42   ` Johannes Weiner
2022-09-10  6:50 ` [PATCH 3/5] btrfs: add manual PSI accounting for compressed reads Christoph Hellwig
2022-09-12 15:28   ` David Sterba
2022-09-14 11:46   ` Johannes Weiner
2022-09-10  6:50 ` [PATCH 4/5] erofs: add manual PSI accounting for the compressed address space Christoph Hellwig
2022-09-14 11:47   ` Johannes Weiner
2022-09-14 12:47   ` Gao Xiang
2022-09-10  6:50 ` [PATCH 5/5] block: remove PSI accounting from the bio layer Christoph Hellwig
2022-09-14 11:48   ` Johannes Weiner
2022-09-10 11:32 ` improve pagecache PSI annotations Jens Axboe
2022-09-15  9:41 improve pagecache PSI annotations v2 Christoph Hellwig
2022-09-15  9:41 ` [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).