mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chi Zhiling <chizhiling@163.com>
To: akpm@linux-foundation.org, willy@infradead.org
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Chi Zhiling <chizhiling@kylinos.cn>
Subject: [RFC PATCH 0/3] Tiny optimization for large read operations
Date: Wed, 23 Jul 2025 18:18:22 +0800	[thread overview]
Message-ID: <20250723101825.607184-1-chizhiling@163.com> (raw)

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


             reply	other threads:[~2025-07-23 10:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23 10:18 Chi Zhiling [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250723101825.607184-1-chizhiling@163.com \
    --to=chizhiling@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=chizhiling@kylinos.cn \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®