mm/readahead: add a desired folio order for readhead
Subsystems (3)
PATCH 1/1 mm/readahead: add a desired folio order for readhead
This patch adds a desired folio order in file_ra_state in order to get non-zero-order allocation for readahead.
--- include/linux/fs.h | 1 + mm/filemap.c | 2 +- mm/readahead.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
include/linux/fs.h +1 -0
@@ -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; };
mm/filemap.c +1 -1
@@ -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);
mm/readahead.c +1 -1
@@ -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); }
Signature · 1 line
2.52.0.487.g5c8c507ade-goog
Matthew Wilcox
maintainerQuoted 2 lines · Jaegeuk Kim
This patch adds a desired folio order in
file_ra_statein 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.
Quoted 8 lines · Matthew Wilcox
Quoted 2 lines · Jaegeuk Kim
This patch adds a desired folio order in
file_ra_statein 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.