lkml.org 
[lkml]   [2020]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH] mm : using bdi->ra_pages instead of ra->ra_pages within readahead
Date
file->f_ra->ra_pages will remain the initialized value since it opend, which may
be NOT equal to bdi->ra_pages as the latter one is updated somehow(etc,
echo xxx > /sys/block/dm/queue/read_ahead_kb).So having readahead use
bdi->ra_pages.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
mm/filemap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index d78f577..259dcfd 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2499,8 +2499,8 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf)
*/
fpin = maybe_unlock_mmap_for_io(vmf, fpin);
ra->start = max_t(long, 0, offset - ra->ra_pages / 2);
- ra->size = ra->ra_pages;
- ra->async_size = ra->ra_pages / 4;
+ ra->size = inode_to_bdi(mapping->host)->ra_pages;
+ ra->async_size = ra->size / 4;
ra_submit(ra, mapping, file);
return fpin;
}
--
1.9.1
\
 
 \ /
  Last update: 2020-08-13 10:11    [W:0.317 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site