context readahead for concurrent IO
Subsystems (3)
cover context readahead for concurrent IO
Andrew,
The context readahead patches have been floating around for a while. Now that Vladislav confirmed that it helps SCST IO performance, I'd like to push it for more -mm testing outs. I believe this will help many concurrent IO workloads, to name a few: NFS, SCST and even lighttpd.
The patchset is against linux-next, after the earlier filemap and readahead cleanup/fix patches.
Thanks,
Fengguang
PATCH 1/3 radix-tree: add radix_tree_next_hole()
The counterpart of radix_tree_prev_hole(). To be used by context readahead.
---
--- include/linux/radix-tree.h | 2 + lib/radix-tree.c | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)
lib/radix-tree.c +37 -0
@@ -666,6 +666,43 @@ unsigned long radix_tree_next_hole(struc }EXPORT_SYMBOL (radix_tree_next_hole); +/** +* radix_tree_prev_hole - find the prev hole (not-present entry) +* @root: tree root +* @index: index key +* @max_scan: maximum range to search +* +* Search backwards in the range [max(index-max_scan+1, 0), index] +* for the first hole. +* +* Returns: the index of the hole if found, otherwise returns an index +* outside of the set specified (in which case 'index - return >= max_scan' +* will be true). In rare cases of wrap-around, LONG_MAX will be returned. +* +* radix_tree_next_hole may be called under rcu_read_lock. However, like +* radix_tree_gang_lookup, this will not atomically search a snapshot of +* the tree at a single point in time. For example, if a hole is created +* at index 10, then subsequently a hole is created at index 5, +* radix_tree_prev_hole covering both indexes may return 5 if called under +* rcu_read_lock. +*/ +unsigned long radix_tree_prev_hole (struct radix_tree_root *root, +unsigned long index,unsigned long max_scan) +{ +unsigned long i; + +for (i =0 ; i < max_scan; i++) { +if (!radix_tree_lookup (root, index)) +break ; + index--; +if (index ==LONG_MAX ) +break ; + } + +return index; +} +EXPORT_SYMBOL (radix_tree_prev_hole); +static unsigned int __lookup (struct radix_tree_node *slot,void ***results,unsigned long index,unsigned int max_items,unsigned long *next_index)
include/linux/radix-tree.h +2 -0
@@ -167,6 +167,8 @@ radix_tree_gang_lookup_slot(struct radix unsigned long first_index, unsigned int max_items);unsigned long radix_tree_next_hole (struct radix_tree_root *root,unsigned long index,unsigned long max_scan); +unsigned long radix_tree_prev_hole (struct radix_tree_root *root, +unsigned long index,unsigned long max_scan);int radix_tree_preload (gfp_t gfp_mask);void radix_tree_init (void ); void *radix_tree_tag_set(struct radix_tree_root *root,
Re: [PATCH 1/3] radix-tree: add radix_tree_next_hole()
Heh silly mistake: the title should say radix_tree_prev_hole() and the changelog should be 'counterpart of radix_tree_next_hole()'.
Will resubmit this one...
Quoted 68 lines · Fengguang
The counterpart of
radix_tree_prev_hole(). To be used by context readahead.Signed-off-by Wu Fengguang <[email protected]>---
--- include/linux/radix-tree.h | 2 + lib/radix-tree.c | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)lib/radix-tree.c +37
-0@@ -666,6 +666,43 @@ unsigned long radix_tree_next_hole(struc }EXPORT_SYMBOL (radix_tree_next_hole); +/** +* radix_tree_prev_hole - find the prev hole (not-present entry) +* @root: tree root +* @index: index key +* @max_scan: maximum range to search +* +* Search backwards in the range [max(index-max_scan+1, 0), index] +* for the first hole. +* +* Returns: the index of the hole if found, otherwise returns an index +* outside of the set specified (in which case 'index - return >= max_scan' +* will be true). In rare cases of wrap-around, LONG_MAX will be returned. +* +* radix_tree_next_hole may be called under rcu_read_lock. However, like +* radix_tree_gang_lookup, this will not atomically search a snapshot of +* the tree at a single point in time. For example, if a hole is created +* at index 10, then subsequently a hole is created at index 5, +* radix_tree_prev_hole covering both indexes may return 5 if called under +* rcu_read_lock. +*/ +unsigned long radix_tree_prev_hole (struct radix_tree_root *root, +unsigned long index,unsigned long max_scan) +{ +unsigned long i; + +for (i =0 ; i < max_scan; i++) { +if (!radix_tree_lookup (root, index)) +break ; + index--; +if (index ==LONG_MAX ) +break ; + } + +return index; +} +EXPORT_SYMBOL (radix_tree_prev_hole); +static unsigned int __lookup (struct radix_tree_node *slot,void ***results,unsigned long index,unsigned int max_items,unsigned long *next_index)include/linux/radix-tree.h +2
-0@@ -167,6 +167,8 @@ radix_tree_gang_lookup_slot(struct radix unsigned long first_index, unsigned int max_items);unsigned long radix_tree_next_hole (struct radix_tree_root *root,unsigned long index,unsigned long max_scan); +unsigned long radix_tree_prev_hole (struct radix_tree_root *root, +unsigned long index,unsigned long max_scan);int radix_tree_preload (gfp_t gfp_mask);void radix_tree_init (void ); void *radix_tree_tag_set(struct radix_tree_root *root,Signature · 1 line
--
PATCH 1/3 radix-tree: add radix_tree_prev_hole()
In reply to Wu FengguangThe counterpart of radix_tree_next_hole(). To be used by context readahead.
--- include/linux/radix-tree.h | 2 + lib/radix-tree.c | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)
lib/radix-tree.c +37 -0
@@ -666,6 +666,43 @@ unsigned long radix_tree_next_hole(struc }EXPORT_SYMBOL (radix_tree_next_hole); +/** +* radix_tree_prev_hole - find the prev hole (not-present entry) +* @root: tree root +* @index: index key +* @max_scan: maximum range to search +* +* Search backwards in the range [max(index-max_scan+1, 0), index] +* for the first hole. +* +* Returns: the index of the hole if found, otherwise returns an index +* outside of the set specified (in which case 'index - return >= max_scan' +* will be true). In rare cases of wrap-around, LONG_MAX will be returned. +* +* radix_tree_next_hole may be called under rcu_read_lock. However, like +* radix_tree_gang_lookup, this will not atomically search a snapshot of +* the tree at a single point in time. For example, if a hole is created +* at index 10, then subsequently a hole is created at index 5, +* radix_tree_prev_hole covering both indexes may return 5 if called under +* rcu_read_lock. +*/ +unsigned long radix_tree_prev_hole (struct radix_tree_root *root, +unsigned long index,unsigned long max_scan) +{ +unsigned long i; + +for (i =0 ; i < max_scan; i++) { +if (!radix_tree_lookup (root, index)) +break ; + index--; +if (index ==LONG_MAX ) +break ; + } + +return index; +} +EXPORT_SYMBOL (radix_tree_prev_hole); +static unsigned int __lookup (struct radix_tree_node *slot,void ***results,unsigned long index,unsigned int max_items,unsigned long *next_index)
include/linux/radix-tree.h +2 -0
@@ -167,6 +167,8 @@ radix_tree_gang_lookup_slot(struct radix unsigned long first_index, unsigned int max_items);unsigned long radix_tree_next_hole (struct radix_tree_root *root,unsigned long index,unsigned long max_scan); +unsigned long radix_tree_prev_hole (struct radix_tree_root *root, +unsigned long index,unsigned long max_scan);int radix_tree_preload (gfp_t gfp_mask);void radix_tree_init (void ); void *radix_tree_tag_set(struct radix_tree_root *root,
PATCH 2/3 readahead: move the random read case to bottom
In reply to Wu FengguangSplit all readahead cases, and move the random one to bottom.
No behavior changes.
This is to prepare for the introduction of context readahead, and make it easy for inserting accounting/tracing points for each case.
--- mm/readahead.c | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-)
mm/readahead.c +25 -21
@@ -339,33 +339,25 @@ ondemand_readahead(struct address_space unsigned long req_size) {unsigned long max =max_sane_readahead (ra->ra_pages); -pgoff_t prev_offset; -int sequential; + +/* +* start of file +*/ +if (!offset) + goto initial_readahead;/* * It's the expected callback offset, assume sequential access. * Ramp up sizes, and push forward the readahead window. */ -if (offset && (offset == (ra->start + ra->size - ra->async_size) || - offset == (ra->start + ra->size))) { +if ((offset == (ra->start + ra->size - ra->async_size) || + offset == (ra->start + ra->size))) { ra->start += ra->size; ra->size =get_next_ra_size (ra, max); ra->async_size = ra->size; goto readit; } - prev_offset = ra->prev_pos >>PAGE_CACHE_SHIFT ; - sequential = offset - prev_offset <=1UL || req_size > max; - -/* -* Standalone, small read. -* Read as is, and do not pollute the readahead state. -*/ -if (!hit_readahead_marker && !sequential) { -return __do_page_cache_readahead (mapping, filp, - offset, req_size,0 ); - } -/* * Hit a marked page without valid readahead state. * E.g. interleaved reads.
@@ -391,12 +383,24 @@ ondemand_readahead(struct address_space }/* -* It may be one of -* - first read on start of file -* - sequential cache miss -* - oversize random read -* Start readahead for it. +* oversize read */ +if (req_size > max) + goto initial_readahead; + +/* +* sequential cache miss +*/ +if (offset - (ra->prev_pos >>PAGE_CACHE_SHIFT ) <=1UL ) + goto initial_readahead; + +/* +* standalone, small random read +* Read as is, and do not pollute the readahead state. +*/ +return __do_page_cache_readahead (mapping, filp, offset, req_size,0 ); + +initial_readahead: ra->start = offset; ra->size =get_init_ra_size (req_size, max); ra->async_size = ra->size > req_size ? ra->size - req_size : ra->size;
PATCH 3/3 readahead: introduce context readahead algorithm
In reply to Wu FengguangIntroduce page cache context based readahead algorithm. This is to better support concurrent read streams in general.
RATIONALE
---------
The current readahead algorithm detects interleaved reads in a _passive_ way. Given a sequence of interleaved streams 1,1001,2,1002,3,4,1003,5,1004,1005,6,... By checking for (offset == prev_offset + 1), it will discover the sequentialness between 3,4 and between 1004,1005, and start doing sequential readahead for the individual streams since page 4 and page 1005.
The context readahead algorithm guarantees to discover the sequentialness no matter how the streams are interleaved. For the above example, it will start sequential readahead since page 2 and 1002.
The trick is to poke for page @offset-1 in the page cache when it has no other clues on the sequentialness of request @offset: if the current requenst belongs to a sequential stream, that stream must have accessed page @offset-1 recently, and the page will still be cached now. So if page @offset-1 is there, we can take request @offset as a sequential access.
BENEFICIARIES
-------------
- strictly interleaved reads i.e. 1,1001,2,1002,3,1003,... the current readahead will take them as silly random reads; the context readahead will take them as two sequential streams.
- seeky _column_ iterations on a huge matrix
Yes it can be regard as _massively_ interleaved streams! Context readahead could transform the 1-page IOs (@offset+@size):
0+1, 1000+1, 2000+1, 3000+1, ..., 1+1, 1001+1, 2001+1, 3001+1, ..., 2+1, 1002+1, 2002+1, 3002+1, ... into larger sized IOs: 0+1, 1000+1, 2000+1, 3000+1, ..., 1+4, 1001+4, 2001+4, 3001+4, ..., 5+8, 1005+8, 2005+8, 3005+8, ...
- cooperative IO processes i.e. NFS and SCST
They create a thread pool, farming off (sequential) IO requests to different threads which will be performing interleaved IO.
It was not easy(or possible) to reliably tell from file->f_ra all those cooperative processes working on the same sequential stream, since they will have different file->f_ra instances. And NFSD's file->f_ra is particularly unusable, since their file objects are dynamically created for each request. The nfsd does have code trying to restore the f_ra bits, but not satisfactory.
The new scheme is to detect the sequential pattern via looking up the page cache, which provides one single and consistent view of the pages recently accessed. That makes sequential detection for cooperative processes possible.
USER REPORT
-----------
Vladislav recommends the addition of context readahead as a result of his SCST benchmarks. It leads to 6%~40% performance gains in various cases and achieves
equal performance in others. http://lkml.org/lkml/2009/3/19/239
OVERHEADS
---------
In theory, it introduces one extra page cache lookup per random read. However the below benchmark shows context readahead to be slightly faster, wondering..
Randomly reading 200MB amount of data on a sparse file, repeat 20 times for each block size. The average throughputs are:
original ra context ra gain
4K random reads: 65.561MB/s 65.648MB/s +0.1%
16K random reads: 124.767MB/s 124.951MB/s +0.1%
64K random reads: 162.123MB/s 162.278MB/s +0.1%
--- mm/readahead.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+)
mm/readahead.c +60 -0
@@ -330,6 +330,59 @@ static unsigned long get_next_ra_size(st*/ /* +* Count continuously cached pages from @offset-1 to @offset-@max, +* this count is a conservative estimation of +* - length of the sequential read sequence, or +* - thrashing threshold in memory tight systems +*/ +static unsigned long count_history_pages (struct address_space *mapping, +struct file_ra_state *ra, +pgoff_t offset,unsigned long max) +{ +pgoff_t head; + +rcu_read_lock (); + head =radix_tree_prev_hole (&mapping->page_tree, offset -1 , max); +rcu_read_unlock (); + +return offset -1 - head; +} + +/* +* page cache context based read-ahead +*/ +static int try_context_readahead (struct address_space *mapping, +struct file_ra_state *ra, +pgoff_t offset, +unsigned long req_size, +unsigned long max) +{ +unsigned long size; + + size =count_history_pages (mapping, ra, offset, max); + +/* +* no history pages: +* it could be a random read +*/ +if (!size) +return 0 ; + +/* +* starts from beginning of file: +* it is a strong indication of long-run stream (or whole-file-read) +*/ +if (size >= offset) + size *=2 ; + + ra->start = offset; + ra->size =get_init_ra_size (size + req_size, max); + ra->async_size = ra->size; + +return 1 ; +} + +/* * A minimal readahead algorithm for trivial sequential/random reads. */ static unsigned long
@@ -395,6 +448,13 @@ ondemand_readahead(struct address_space goto initial_readahead;/* +* Query the page cache and look for the traces(cached history pages) +* that a sequential stream would leave behind. +*/ +if (try_context_readahead (mapping, ra, offset, req_size, max)) + goto readit; + +/* * standalone, small random read * Read as is, and do not pollute the readahead state. */
Andrew Morton
maintainerRe: [PATCH 3/3] readahead: introduce context readahead algorithm
Quoted 83 lines · On Fri, 10 Apr 2009 21:12:50 +0800 Wu Fengguang <[email protected]> wrote:
Introduce page cache context based readahead algorithm. This is to better support concurrent read streams in general.
RATIONALE
---------
The current readahead algorithm detects interleaved reads in a _passive_ way. Given a sequence of interleaved streams 1,1001,2,1002,3,4,1003,5,1004,1005,6,... By checking for (offset ==prev_offset+ 1), it will discover the sequentialness between 3,4 and between 1004,1005, and start doing sequential readahead for the individual streams since page 4 and page 1005.The context readahead algorithm guarantees to discover the sequentialness no matter how the streams are interleaved. For the above example, it will start sequential readahead since page 2 and 1002.
The trick is to poke for page @offset-1 in the page cache when it has no other clues on the sequentialness of request @offset: if the current requenst belongs to a sequential stream, that stream must have accessed page @offset-1 recently, and the page will still be cached now. So if page @offset-1 is there, we can take request @offset as a sequential access.
BENEFICIARIES
-------------
- strictly interleaved reads i.e. 1,1001,2,1002,3,1003,... the current readahead will take them as silly random reads; the context readahead will take them as two sequential streams.- seeky _column_ iterations on a huge matrix
Yes it can be regard as _massively_ interleaved streams! Context readahead could transform the 1-page IOs (@offset+@size):0+1, 1000+1, 2000+1, 3000+1, ..., 1+1, 1001+1, 2001+1, 3001+1, ..., 2+1, 1002+1, 2002+1, 3002+1, ... into larger sized IOs: 0+1, 1000+1, 2000+1, 3000+1, ..., 1+4, 1001+4, 2001+4, 3001+4, ..., 5+8, 1005+8, 2005+8, 3005+8, ...- cooperative IO processes i.e. NFS and SCST
They create a thread pool, farming off (sequential) IO requests to different threads which will be performing interleaved IO.It was not easy(or possible) to reliably tell from
file->f_raall those cooperative processes working on the same sequential stream, since they will have differentfile->f_rainstances. And NFSD'sfile->f_rais particularly unusable, since their file objects are dynamically created for each request. The nfsd does have code trying to restore thef_rabits, but not satisfactory.The new scheme is to detect the sequential pattern via looking up the page cache, which provides one single and consistent view of the pages recently accessed. That makes sequential detection for cooperative processes possible.
USER REPORT
-----------
Vladislav recommends the addition of context readahead as a result of his SCST benchmarks. It leads to 6%~40% performance gains in various cases and achieves
equal performance in others. http://lkml.org/lkml/2009/3/19/239OVERHEADS
---------
In theory, it introduces one extra page cache lookup per random read. However the below benchmark shows context readahead to be slightly faster, wondering..Randomly reading 200MB amount of data on a sparse file, repeat 20 times for each block size. The average throughputs are:
original ra context ra gain
4K random reads: 65.561MB/s 65.648MB/s +0.1%
16K random reads: 124.767MB/s 124.951MB/s +0.1%
64K random reads: 162.123MB/s 162.278MB/s +0.1%Cc Jens Axboe <[email protected]>Cc Jeff Moyer <[email protected]>Signed-off-by Wu Fengguang <[email protected]>--- mm/readahead.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+)
mm/readahead.c static unsigned long get_next_ra_size(st · line 333
Quoted 4 lines
mm/readahead.c +1
-0@@ -330,6 +330,59 @@ static unsigned long get_next_ra_size(st*/ /* +* Count continuously cached pages from @offset-1 to @offset-@max,
You meant "contiguously" here, yes?
Quoted 6 lines
mm/readahead.c +6
-0+* this count is a conservative estimation of +* - length of the sequential read sequence, or +* - thrashing threshold in memory tight systems +*/ +static unsigned long count_history_pages(struct address_space *mapping, + struct file_ra_state *ra,
mm/readahead.c static unsigned long get_next_ra_size(st · line 349
Quoted 10 lines
mm/readahead.c +10
-0+ pgoff_t offset, unsigned long max) +{ +pgoff_t head; + +rcu_read_lock (); + head =radix_tree_prev_hole (&mapping->page_tree, offset -1 , max); +rcu_read_unlock (); + +return offset -1 - head; +}
Doesn't matter much, but perhaps this should return pgoff_t.
mm/readahead.c static unsigned long get_next_ra_size(st · line 360
Quoted 10 lines
mm/readahead.c +10
-0+/* +* page cache context based read-ahead +*/ +static int try_context_readahead (struct address_space *mapping, +struct file_ra_state *ra, +pgoff_t offset, +unsigned long req_size, +unsigned long max) +{ +unsigned long size;
And this could be pgoff_t too.
Quoted 43 lines
mm/readahead.c +31
-0+ size =count_history_pages (mapping, ra, offset, max); + +/* +* no history pages: +* it could be a random read +*/ +if (!size) +return 0 ; + +/* +* starts from beginning of file: +* it is a strong indication of long-run stream (or whole-file-read) +*/ +if (size >= offset) + size *=2 ; + + ra->start = offset; + ra->size =get_init_ra_size (size + req_size, max); + ra->async_size = ra->size; + +return 1 ; +} + +/* * A minimal readahead algorithm for trivial sequential/random reads. */ static unsigned long@@ -395,6 +448,13 @@ ondemand_readahead(struct address_space goto initial_readahead;/* +* Query the page cache and look for the traces(cached history pages) +* that a sequential stream would leave behind. +*/ +if (try_context_readahead (mapping, ra, offset, req_size, max)) + goto readit; + +/* * standalone, small random read * Read as is, and do not pollute the readahead state. */ Signature · 1 line
--
Re: [PATCH 3/3] readahead: introduce context readahead algorithm
Quoted 88 lines · Andrew Morton
Quoted 85 lines · On Fri, 10 Apr 2009 21:12:50 +0800 Wu Fengguang <[email protected]> wrote:
Introduce page cache context based readahead algorithm. This is to better support concurrent read streams in general.
RATIONALE
---------
The current readahead algorithm detects interleaved reads in a _passive_ way. Given a sequence of interleaved streams 1,1001,2,1002,3,4,1003,5,1004,1005,6,... By checking for (offset ==prev_offset+ 1), it will discover the sequentialness between 3,4 and between 1004,1005, and start doing sequential readahead for the individual streams since page 4 and page 1005.The context readahead algorithm guarantees to discover the sequentialness no matter how the streams are interleaved. For the above example, it will start sequential readahead since page 2 and 1002.
The trick is to poke for page @offset-1 in the page cache when it has no other clues on the sequentialness of request @offset: if the current requenst belongs to a sequential stream, that stream must have accessed page @offset-1 recently, and the page will still be cached now. So if page @offset-1 is there, we can take request @offset as a sequential access.
BENEFICIARIES
-------------
- strictly interleaved reads i.e. 1,1001,2,1002,3,1003,... the current readahead will take them as silly random reads; the context readahead will take them as two sequential streams.- seeky _column_ iterations on a huge matrix
Yes it can be regard as _massively_ interleaved streams! Context readahead could transform the 1-page IOs (@offset+@size):0+1, 1000+1, 2000+1, 3000+1, ..., 1+1, 1001+1, 2001+1, 3001+1, ..., 2+1, 1002+1, 2002+1, 3002+1, ... into larger sized IOs: 0+1, 1000+1, 2000+1, 3000+1, ..., 1+4, 1001+4, 2001+4, 3001+4, ..., 5+8, 1005+8, 2005+8, 3005+8, ...- cooperative IO processes i.e. NFS and SCST
They create a thread pool, farming off (sequential) IO requests to different threads which will be performing interleaved IO.It was not easy(or possible) to reliably tell from
file->f_raall those cooperative processes working on the same sequential stream, since they will have differentfile->f_rainstances. And NFSD'sfile->f_rais particularly unusable, since their file objects are dynamically created for each request. The nfsd does have code trying to restore thef_rabits, but not satisfactory.The new scheme is to detect the sequential pattern via looking up the page cache, which provides one single and consistent view of the pages recently accessed. That makes sequential detection for cooperative processes possible.
USER REPORT
-----------
Vladislav recommends the addition of context readahead as a result of his SCST benchmarks. It leads to 6%~40% performance gains in various cases and achieves
equal performance in others. http://lkml.org/lkml/2009/3/19/239OVERHEADS
---------
In theory, it introduces one extra page cache lookup per random read. However the below benchmark shows context readahead to be slightly faster, wondering..Randomly reading 200MB amount of data on a sparse file, repeat 20 times for each block size. The average throughputs are:
original ra context ra gain
4K random reads: 65.561MB/s 65.648MB/s +0.1%
16K random reads: 124.767MB/s 124.951MB/s +0.1%
64K random reads: 162.123MB/s 162.278MB/s +0.1%Cc Jens Axboe <[email protected]>Cc Jeff Moyer <[email protected]>Signed-off-by Wu Fengguang <[email protected]>--- mm/readahead.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+)mm/readahead.c +0
-0@@ -330,6 +330,59 @@ static unsigned long get_next_ra_size(st*/
Quoted 4 lines
mm/readahead.c static unsigned long get_next_ra_size(st · line 333
Quoted 2 lines
mm/readahead.c +1
-0/* +* Count continuously cached pages from @offset-1 to @offset-@max, You meant "contiguously" here, yes?
Ah yes, continuously for time and contiguously for space?
Quoted 10 lines
Quoted 10 lines
mm/readahead.c +10
-0+* this count is a conservative estimation of +* - length of the sequential read sequence, or +* - thrashing threshold in memory tight systems +*/ +static unsigned long count_history_pages (struct address_space *mapping, +struct file_ra_state *ra, +pgoff_t offset,unsigned long max) +{ +pgoff_t head; +
Quoted 8 lines
mm/readahead.c static unsigned long get_next_ra_size(st · line 349
Quoted 6 lines
mm/readahead.c +6
-0+rcu_read_lock (); + head =radix_tree_prev_hole (&mapping->page_tree, offset -1 , max); +rcu_read_unlock (); + +return offset -1 - head; +}Doesn't matter much, but perhaps this should return
pgoff_t.
Do you indicate to use pgoff_t for size?
Quoted 4 lines
Quoted 4 lines
mm/readahead.c +4
-0+/* +* page cache context based read-ahead +*/ +static int try_context_readahead(struct address_space *mapping,
Quoted 8 lines
mm/readahead.c static unsigned long get_next_ra_size(st · line 360
Quoted 6 lines
mm/readahead.c +6
-0+struct file_ra_state *ra, + pgoff_t offset, + unsigned long req_size, + unsigned long max) +{ + unsigned long size;And this could be
pgoff_ttoo.
OK. I'll repost the whole series.
Thanks,
Fengguang