[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240213164634.GV6184@frogsfrogsfrogs>
Date: Tue, 13 Feb 2024 08:46:34 -0800
From: "Darrick J. Wong" <djwong@...nel.org>
To: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
Cc: linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
mcgrof@...nel.org, gost.dev@...sung.com, akpm@...ux-foundation.org,
kbusch@...nel.org, chandan.babu@...cle.com, p.raghav@...sung.com,
linux-kernel@...r.kernel.org, hare@...e.de, willy@...radead.org,
linux-mm@...ck.org, david@...morbit.com
Subject: Re: [RFC v2 04/14] readahead: set file_ra_state->ra_pages to be at
least mapping_min_order
On Tue, Feb 13, 2024 at 10:37:03AM +0100, Pankaj Raghav (Samsung) wrote:
> From: Luis Chamberlain <mcgrof@...nel.org>
>
> Set the file_ra_state->ra_pages in file_ra_state_init() to be at least
> mapping_min_order of pages if the bdi->ra_pages is less than that.
>
> Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
Looks good to me,
Acked-by: Darrick J. Wong <djwong@...nel.org>
--D
> ---
> mm/readahead.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/mm/readahead.c b/mm/readahead.c
> index 2648ec4f0494..4fa7d0e65706 100644
> --- a/mm/readahead.c
> +++ b/mm/readahead.c
> @@ -138,7 +138,12 @@
> void
> file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
> {
> + unsigned int min_nrpages = mapping_min_folio_nrpages(mapping);
> + unsigned int max_pages = inode_to_bdi(mapping->host)->io_pages;
> +
> ra->ra_pages = inode_to_bdi(mapping->host)->ra_pages;
> + if (ra->ra_pages < min_nrpages && min_nrpages < max_pages)
> + ra->ra_pages = min_nrpages;
> ra->prev_pos = -1;
> }
> EXPORT_SYMBOL_GPL(file_ra_state_init);
> --
> 2.43.0
>
>
Powered by blists - more mailing lists