All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 3/3] mm/readahead: try to allocate high order pages for FADVISE_FAV_WILLNEED
Date: Fri, 16 Jan 2026 04:41:03 +0000	[thread overview]
Message-ID: <aWnBX07vqjKAV4De@google.com> (raw)
In-Reply-To: <aTCJ0Js4X7qlqzDZ@google.com>

On 12/03, Jaegeuk Kim wrote:
> On 12/02, Matthew Wilcox wrote:
> > On Tue, Dec 02, 2025 at 01:30:13AM +0000, Jaegeuk Kim wrote:
> > > @@ -627,7 +628,7 @@ void page_cache_sync_ra(struct readahead_control *ractl,
> > >  	ra->size = min(contig_count + req_count, max_pages);
> > >  	ra->async_size = 1;
> > >  readit:
> > > -	ra->order = 0;
> > > +	ra->order = mapping_max_folio_order(ractl->mapping);
> > >  	ractl->_index = ra->start;
> > >  	page_cache_ra_order(ractl, ra);
> > >  }
> > 
> > I suspect this is in the wrong place, but I'm on holiday and not going
> > to go spelunking through the readahead code looking for the right place.
> > 
> > Also, going directly to max folio order is wrong, we should use the same
> > approach as the write order code, encapsulated in filemap_get_order().
> > See 4f6617011910
> 
> It seems the key is page_cache_ra_order() which allocates pages by
> ra_alloc_folio() given ra->order. FWIW, madvise() and fault() readahead
> takes page_cache_async_ra(), while fadvise() takes page_cache_sync_ra().
> And, the former one has a logic to bump up the ra->order += 2 by f838ddf8cef5.
> I think it'd make sense to match that behavior?

Comment by any chance?


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org
Subject: Re: [PATCH 3/3] mm/readahead: try to allocate high order pages for FADVISE_FAV_WILLNEED
Date: Fri, 16 Jan 2026 04:41:03 +0000	[thread overview]
Message-ID: <aWnBX07vqjKAV4De@google.com> (raw)
In-Reply-To: <aTCJ0Js4X7qlqzDZ@google.com>

On 12/03, Jaegeuk Kim wrote:
> On 12/02, Matthew Wilcox wrote:
> > On Tue, Dec 02, 2025 at 01:30:13AM +0000, Jaegeuk Kim wrote:
> > > @@ -627,7 +628,7 @@ void page_cache_sync_ra(struct readahead_control *ractl,
> > >  	ra->size = min(contig_count + req_count, max_pages);
> > >  	ra->async_size = 1;
> > >  readit:
> > > -	ra->order = 0;
> > > +	ra->order = mapping_max_folio_order(ractl->mapping);
> > >  	ractl->_index = ra->start;
> > >  	page_cache_ra_order(ractl, ra);
> > >  }
> > 
> > I suspect this is in the wrong place, but I'm on holiday and not going
> > to go spelunking through the readahead code looking for the right place.
> > 
> > Also, going directly to max folio order is wrong, we should use the same
> > approach as the write order code, encapsulated in filemap_get_order().
> > See 4f6617011910
> 
> It seems the key is page_cache_ra_order() which allocates pages by
> ra_alloc_folio() given ra->order. FWIW, madvise() and fault() readahead
> takes page_cache_async_ra(), while fadvise() takes page_cache_sync_ra().
> And, the former one has a logic to bump up the ra->order += 2 by f838ddf8cef5.
> I think it'd make sense to match that behavior?

Comment by any chance?


  reply	other threads:[~2026-01-16  4:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02  1:30 [f2fs-dev] [PATCH 0/3 v2] improve fadvise(POSIX_FADV_WILLNEED) with large folio Jaegeuk Kim via Linux-f2fs-devel
2025-12-02  1:30 ` Jaegeuk Kim
2025-12-02  1:30 ` [f2fs-dev] [PATCH 1/3] mm/readahead: fix the broken readahead for POSIX_FADV_WILLNEED Jaegeuk Kim via Linux-f2fs-devel
2025-12-02  1:30   ` Jaegeuk Kim
2025-12-02  1:30 ` [f2fs-dev] [PATCH 2/3] mm/readahead: use page_cache_sync_ra for FADVISE_FAV_WILLNEED Jaegeuk Kim via Linux-f2fs-devel
2025-12-02  1:30   ` Jaegeuk Kim
2025-12-02  1:30 ` [f2fs-dev] [PATCH 3/3] mm/readahead: try to allocate high order pages " Jaegeuk Kim via Linux-f2fs-devel
2025-12-02  1:30   ` Jaegeuk Kim
2025-12-02 22:56   ` [f2fs-dev] " Matthew Wilcox
2025-12-02 22:56     ` Matthew Wilcox
2025-12-03 19:04     ` [f2fs-dev] " Jaegeuk Kim via Linux-f2fs-devel
2025-12-03 19:04       ` Jaegeuk Kim
2026-01-16  4:41       ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2026-01-16  4:41         ` Jaegeuk Kim
2025-12-03 23:25   ` [f2fs-dev] [PATCH 3/3 v2] " Jaegeuk Kim via Linux-f2fs-devel
2025-12-03 23:25     ` Jaegeuk Kim

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=aWnBX07vqjKAV4De@google.com \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=jaegeuk@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.