readahead: remove redundant test in shrink_readahead_size_eio()
Subsystems (2)
PATCH 1/1 readahead: remove redundant test in shrink_readahead_size_eio()
Signed-off-by Wu Fengguang <[email protected]>
--- mm/filemap.c | 3 --- 1 file changed, 3 deletions(-)
mm/filemap.c +0 -3
@@ -1072,9 +1072,6 @@ EXPORT_SYMBOL(grab_cache_page_nowait);static void shrink_readahead_size_eio (struct file *filp,struct file_ra_state *ra) { -if (!ra->ra_pages) -return ; - ra->ra_pages /=4 ; }
A message that is not in the archive (sent off-list or not yet received): 1239726034.32203.129.camel@localhost
Quoted 20 lines · Joe Perches
Quoted 8 lines · Wu Fengguang
Signed-off-by Wu Fengguang <[email protected]>--- mm/filemap.c | 3 --- 1 file changed, 3 deletions(-)mm/filemap.c EXPORT_SYMBOL(grab_cache_page_nowait); · line 1076
Quoted 8 lines
mm/filemap.c +0
-3@@ -1072,9 +1072,6 @@ EXPORT_SYMBOL(grab_cache_page_nowait);static void shrink_readahead_size_eio (struct file *filp,struct file_ra_state *ra) { -if (!ra->ra_pages) -return ; - ra->ra_pages /=4 ; }I'm not sure this is redundant.
Quoted 2 lines
Perhaps it was seen as an optimization
given the expense of division.
Nope. It was mainly a way to avoid extra warning messages. There used to be a printk() between the testing and division.
The division shall be optimized by gcc into a bit shift op. Anyway this is a very cold execution path, so code size is much more relevant than its efficiency.
Thanks,
Fengguang