lkml.org 
[lkml]   [2024]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 2/2] mm: introduce budgt control in readahead
On Thu, May 09, 2024 at 10:39:37AM +0800, zhaoyang.huang wrote:
> -static unsigned long get_next_ra_size(struct file_ra_state *ra,
> +static unsigned long get_next_ra_size(struct readahead_control *ractl,
> unsigned long max)
> {
> - unsigned long cur = ra->size;
> + unsigned long cur = ractl->ra->size;
> + struct inode *inode = ractl->mapping->host;
> + unsigned long budgt = inode->i_sb->s_bdev ?
> + blk_throttle_budgt(inode->i_sb->s_bdev) : 0;

You can't do this. There's no guarantee that the IO is going to
mapping->host->i_sb->s_bdev. You'd have to figure out how to ask the
filesystem to get the bdev for the particular range (eg the fs might
implement RAID internally).


\
 
 \ /
  Last update: 2024-05-09 05:16    [W:0.053 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site