* [PATCH] mm/readahead: add a desired folio order for readhead
@ 2025-11-21 1:48 Jaegeuk Kim
2025-11-21 14:30 ` Matthew Wilcox
0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2025-11-21 1:48 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel
Cc: Jaegeuk Kim, David Hildenbrand, Matthew Wilcox (Oracle)
This patch adds a desired folio order in file_ra_state in order to get
non-zero-order allocation for readahead.
Cc: David Hildenbrand <david@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
include/linux/fs.h | 1 +
mm/filemap.c | 2 +-
mm/readahead.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c895146c1444..8233b166139b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1167,6 +1167,7 @@ struct file_ra_state {
unsigned int async_size;
unsigned int ra_pages;
unsigned short order;
+ unsigned short desired_order;
unsigned short mmap_miss;
loff_t prev_pos;
};
diff --git a/mm/filemap.c b/mm/filemap.c
index 13f0259d993c..6aa0e26c5d17 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3332,7 +3332,7 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf)
ra->start = max_t(long, 0, vmf->pgoff - ra->ra_pages / 2);
ra->size = ra->ra_pages;
ra->async_size = ra->ra_pages / 4;
- ra->order = 0;
+ ra->order = ra->desired_order;
}
fpin = maybe_unlock_mmap_for_io(vmf, fpin);
diff --git a/mm/readahead.c b/mm/readahead.c
index 3a4b5d58eeb6..5194211dfdee 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -621,7 +621,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 = ra->desired_order;
ractl->_index = ra->start;
page_cache_ra_order(ractl, ra);
}
--
2.52.0.487.g5c8c507ade-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/readahead: add a desired folio order for readhead
2025-11-21 1:48 [PATCH] mm/readahead: add a desired folio order for readhead Jaegeuk Kim
@ 2025-11-21 14:30 ` Matthew Wilcox
2025-11-21 18:03 ` Jaegeuk Kim
0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2025-11-21 14:30 UTC (permalink / raw)
To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel, David Hildenbrand
On Fri, Nov 21, 2025 at 01:48:11AM +0000, Jaegeuk Kim wrote:
> This patch adds a desired folio order in file_ra_state in order to get
> non-zero-order allocation for readahead.
Why? Does it not ramp up quickly enough for you?
I see a lot of patches from you that say what the patch does but very
little about why. Please explain yourself more.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm/readahead: add a desired folio order for readhead
2025-11-21 14:30 ` Matthew Wilcox
@ 2025-11-21 18:03 ` Jaegeuk Kim
0 siblings, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2025-11-21 18:03 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-kernel, linux-f2fs-devel, David Hildenbrand
On 11/21, Matthew Wilcox wrote:
> On Fri, Nov 21, 2025 at 01:48:11AM +0000, Jaegeuk Kim wrote:
> > This patch adds a desired folio order in file_ra_state in order to get
> > non-zero-order allocation for readahead.
>
> Why? Does it not ramp up quickly enough for you?
>
> I see a lot of patches from you that say what the patch does but very
> little about why. Please explain yourself more.
Yeah, let me revisit the patches and post another version that uplifts
code into mm/fs with what I'm trying to address.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-21 18:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 1:48 [PATCH] mm/readahead: add a desired folio order for readhead Jaegeuk Kim
2025-11-21 14:30 ` Matthew Wilcox
2025-11-21 18:03 ` Jaegeuk Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox