linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: zippermonkey <zzippermonkey@outlook.com>
Cc: zhangpengpeng0808@gmail.com, akpm@linux-foundation.org,
	bruzzhang@tencent.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	vernhao@tencent.com, willy@infradead.org, zigiwang@tencent.com,
	jack@suse.cz
Subject: Re: [PATCH RFC] mm/readahead: Fix repeat initial_readahead
Date: Tue, 25 Jun 2024 12:36:53 +0200	[thread overview]
Message-ID: <20240625103653.uzabtus3yq2lo3o6@quack3> (raw)
In-Reply-To: <SYBP282MB2224E68F688DD74FFEA86AA6B9D52@SYBP282MB2224.AUSP282.PROD.OUTLOOK.COM>

On Tue 25-06-24 14:28:34, zippermonkey wrote:
> To illustrate this problem, I created the following example:
> 
> Assuming that the process reads sequentially from the beginning of the file
> and
> calls the `page_cache_sync_readahead` function. In this sync readahead
> function,
> since the index is 0, it will proceed to `initial_readahead` and initialize
> `ra_state`. It allocates a folio with an order of 2 and marks it as
> PG_readahead.
> Next, because` (folio_test_readahead(folio))` is true, the
> page_cache_async_ra
> function is called, which causes the `ra_state` to be initialized again.

Good spotting guys! There are actually more problems in the readahead code.
I have just pushed out a patch series [1] addressing several issues that
should also address the problem you've found. Can you please test whether
it provides a similar speedup as your fix (sorry, I forgot to CC you on the
series)? Thanks!

[1] https://lore.kernel.org/20240625100859.15507-1-jack@suse.cz

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


      reply	other threads:[~2024-06-25 10:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 11:49 Peng Zhang
2024-06-25  6:28 ` zippermonkey
2024-06-25 10:36   ` Jan Kara [this message]

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=20240625103653.uzabtus3yq2lo3o6@quack3 \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=bruzzhang@tencent.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=vernhao@tencent.com \
    --cc=willy@infradead.org \
    --cc=zhangpengpeng0808@gmail.com \
    --cc=zigiwang@tencent.com \
    --cc=zzippermonkey@outlook.com \
    /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