linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Tiny optimization for large read operations
@ 2025-07-23 10:18 Chi Zhiling
  2025-07-23 10:18 ` [RFC PATCH 1/3] mm/filemap: Do not use is_partially_uptodate for entire folio Chi Zhiling
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chi Zhiling @ 2025-07-23 10:18 UTC (permalink / raw)
  To: akpm, willy; +Cc: linux-fsdevel, linux-mm, linux-kernel, Chi Zhiling

From: Chi Zhiling <chizhiling@kylinos.cn>

Fine-Tuned Optimization for Large IO Read Operations

When reading data exceeding the maximum IO size, the operation is split into multiple IO requests, but the data isn't immediately copied to user space after IO completion. 
For example, when reading 2560k data from a device with 1280k maximum IO size, the following sequence occurs:

1. read 1280k
2. copy 31 pages to user buffer
3. copy 10 pages and issue read ahead for next 1280k
4. copy 31 pages to user buffer
5. wait the next 1280k
6. copy 8 pages to user buffer
7. copy 20 folios(64k) to user buffer

The 8 pages in step 6 are copied after the second 1280k completes due to waiting for non-uptodate folio in filemap_update_page.
After applying the patch, these 8 pages will be copied before the next IO completes:

1. read 1280k
2. copy 31 pages to user buffer
3. copy 10 pages and issue read ahead for next 1280k
4. copy 31 pages to user buffer
5. copy 8 pages to user buffer
6. wait the next 1280k
7. copy 20 folios(64k) to user buffer

Chi Zhiling (3):
  mm/filemap: Do not use is_partially_uptodate for entire folio
  mm/filemap: Avoid modifying iocb->ki_flags for AIO in
    filemap_get_pages()
  mm/filemap: Skip non-uptodate folio when folios are available

 mm/filemap.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2025-07-24  1:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-23 10:18 [RFC PATCH 0/3] Tiny optimization for large read operations Chi Zhiling
2025-07-23 10:18 ` [RFC PATCH 1/3] mm/filemap: Do not use is_partially_uptodate for entire folio Chi Zhiling
2025-07-23 10:18 ` [RFC PATCH 2/3] mm/filemap: Avoid modifying iocb->ki_flags for AIO in filemap_get_pages() Chi Zhiling
2025-07-23 14:33   ` Matthew Wilcox
2025-07-24  1:54     ` Chi Zhiling
2025-07-23 10:18 ` [RFC PATCH 3/3] mm/filemap: Skip non-uptodate folio when folios are available Chi Zhiling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox