Linux filesystem development
 help / color / mirror / Atom feed
From: Chi Zhiling <chizhiling@163.com>
To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Chi Zhiling <chizhiling@kylinos.cn>
Subject: [PATCH 0/2] mm/filemap: reduce unnecessary xarray lookups
Date: Sat, 20 Jun 2026 14:24:44 +0800	[thread overview]
Message-ID: <20260620062446.351475-1-chizhiling@163.com> (raw)

From: Chi Zhiling <chizhiling@kylinos.cn>

This series optimizes xarray lookups in filemap by avoiding redundant
iterations after obtaining the last needed folio. The boundary check is
moved to before advancing the xarray iterator, eliminating unnecessary
lookups and branches in the fast path. This reduces the overhead of
filemap_get_read_batch() from 2.91% to 2.53% in 4k read tests.

This series is split from a previous patch series:
https://lore.kernel.org/linux-mm/20260601055704.167436-1-chizhiling@163.com/

Chi Zhiling (2):
  mm/filemap: reduce unnecessary xarray lookups when read cached pages
  mm/filemap: reduce unnecessary xarray lookups in filemap_get_folios_contig()

 mm/filemap.c | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

-- 
2.43.0


             reply	other threads:[~2026-06-20  6:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-20  6:24 Chi Zhiling [this message]
2026-06-20  6:24 ` [PATCH 1/2] mm/filemap: reduce unnecessary xarray lookups when read cached pages Chi Zhiling
2026-06-22  9:41   ` Jan Kara
2026-06-20  6:24 ` [PATCH 2/2] mm/filemap: reduce unnecessary xarray lookups in filemap_get_folios_contig() Chi Zhiling
2026-06-22  9:45   ` Jan Kara

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=20260620062446.351475-1-chizhiling@163.com \
    --to=chizhiling@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=chizhiling@kylinos.cn \
    --cc=jack@suse.cz \
    --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