[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-fsdevel
Subject:    Re: [PATCH] readahead: Update the file_ra_state.ra_pages with each readahead operation
From:       Youling Tang <youling.tang () outlook ! com>
Date:       2023-10-31 1:56:29
Message-ID: MW4PR84MB31450CAB2035C820B016E3F581A0A () MW4PR84MB3145 ! NAMPRD84 ! PROD ! OUTLOOK ! COM
[Download RAW message or body]

Hi, Matthew

On 2023/10/31 上午12:47, Matthew Wilcox wrote:
> 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.
Because I initially expected to immediately improve the current read 
performance
by modifying read_ahead_kb when reading large files sequentially.
> Many things are only initialised at open() time and are not updated until
> the next open().  This is longstanding behaviour that some apps expect.
Thanks for your explanation. I will discard this change if the next open 
update is in line with the
apps expectation.

Thanks,
Youling.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic