From: Matthew Wilcox <willy@infradead.org>
To: Youling Tang <youling.tang@outlook.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, tangyouling@kylinos.cn
Subject: Re: [PATCH] readahead: Update the file_ra_state.ra_pages with each readahead operation
Date: Mon, 30 Oct 2023 16:47:06 +0000 [thread overview]
Message-ID: <ZT/eCvQ/Iug8GB1l@casper.infradead.org> (raw)
In-Reply-To: <MW4PR84MB3145AFD512F2C777635765B381A1A@MW4PR84MB3145.NAMPRD84.PROD.OUTLOOK.COM>
On Mon, Oct 30, 2023 at 03:41:30PM +0800, Youling Tang wrote:
> From: Youling Tang <tangyouling@kylinos.cn>
>
> Changing the read_ahead_kb value midway through a sequential read of a
> large file found that the ra->ra_pages value remained unchanged (new
> ra_pages can only be detected the next time the file is opened). Because
> file_ra_state_init() is only called once in do_dentry_open() in most
> cases.
>
> In ondemand_readahead(), update bdi->ra_pages to ra->ra_pages to ensure
> that the maximum pages that can be allocated by the readahead algorithm
> are the same as (read_ahead_kb * 1024) / PAGE_SIZE after read_ahead_kb
> is modified.
Explain to me why this is the correct behaviour.
Many things are only initialised at open() time and are not updated until
the next open(). This is longstanding behaviour that some apps expect.
Why should we change it?
next prev parent reply other threads:[~2023-10-30 16:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 7:41 Youling Tang
2023-10-30 16:47 ` Matthew Wilcox [this message]
2023-10-31 1:56 ` Youling Tang
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=ZT/eCvQ/Iug8GB1l@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=tangyouling@kylinos.cn \
--cc=youling.tang@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