Re: [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls

2022-09-10 Thread Matthew Wilcox
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,

Re: [PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls

2022-09-10 Thread Jens Axboe
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

Re: improve pagecache PSI annotations

2022-09-10 Thread Jens Axboe
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

[PATCH 5/5] block: remove PSI accounting from the bio layer

2022-09-10 Thread Christoph Hellwig
PSI accounting is now done by the VM code, where it should have been since the beginning. Signed-off-by: Christoph Hellwig --- block/bio.c | 8 block/blk-core.c | 17 - fs/direct-io.c| 2 -- include/linux/blk_types.h | 1 - 4 files

[PATCH 1/5] mm: add PSI accounting around ->read_folio and ->readahead calls

2022-09-10 Thread Christoph Hellwig
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

[PATCH 4/5] erofs: add manual PSI accounting for the compressed address space

2022-09-10 Thread Christoph Hellwig
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

[PATCH 2/5] sched/psi: export psi_memstall_{enter,leave}

2022-09-10 Thread Christoph Hellwig
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 --- kernel/sched/psi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index

improve pagecache PSI annotations

2022-09-10 Thread Christoph Hellwig
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:

[PATCH 3/5] btrfs: add manual PSI accounting for compressed reads

2022-09-10 Thread Christoph Hellwig
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