mm-provide-filemap_range_needs_writeback-helper.patch removed from -mm tree
The patch titled
Subject: mm: provide filemap_range_needs_writeback() helper
has been removed from the -mm tree. Its filename was
mm-provide-filemap_range_needs_writeback-helper.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Jens Axboe <[email protected]>
Subject: mm: provide filemap_range_needs_writeback() helper
Patch series "Improve IOCB_NOWAIT O_DIRECT reads", v3.
An internal workload complained because it was using too much CPU, and when I took a look, we had a lot of io_uring workers going to town. For an async buffered read like workload, I am normally expecting _zero_ offloads to a worker thread, but this one had tons of them. I'd drop caches and things would look good again, but then a minute later we'd regress back to using workers. Turns out that every minute something was reading parts of the device, which would add page cache for that inode. I put patches like these in for our kernel, and the problem was solved.
Don't -EAGAIN IOCB_NOWAIT dio reads just because we have page cache entries for the given range. This causes unnecessary work from the callers side, when the IO could have been issued totally fine without blocking on writeback when there is none.
This patch (of 3):
For O_DIRECT reads/writes, we check if we need to issue a call to filemap_write_and_wait_range() to issue and/or wait for writeback for any page in the given range. The existing mechanism just checks for a page in the range, which is suboptimal for IOCB_NOWAIT as we'll fallback to the slow path (and needing retry) if there's just a clean page cache page in the range.
Provide filemap_range_needs_writeback() which tries a little harder to check if we actually need to issue and/or wait for writeback in the range.
---
include/linux/fs.h | 2 ++ mm/filemap.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+)
include/linux/fs.h renamed from include/linux/fs.h~mm-provide-filemap_range_needs_writeback-helper +2 -0
@@ -2878,6 +2878,8 @@ static inline int filemap_fdatawait(struextern bool filemap_range_has_page (struct address_space *,loff_t lstart,loff_t lend); +extern bool filemap_range_needs_writeback (struct address_space *, +loff_t lstart,loff_t lend);extern int filemap_write_and_wait_range (struct address_space *mapping,loff_t lstart,loff_t lend); extern int __filemap_fdatawrite_range(struct address_space *mapping,
mm/filemap.c renamed from mm/filemap.c~mm-provide-filemap_range_needs_writeback-helper +43 -0
49 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are