lkml.org 
[lkml]   [2009]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] readahead: remove redundant test in shrink_readahead_size_eio()
On Wed, Apr 15, 2009 at 12:20:33AM +0800, Joe Perches wrote:
> On Tue, 2009-04-14 at 09:37 +0800, Wu Fengguang wrote:
> > Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> > ---
> > mm/filemap.c | 3 ---
> > 1 file changed, 3 deletions(-)
> >
> > --- mm.orig/mm/filemap.c
> > +++ mm/mm/filemap.c
> > @@ -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.
>
> 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



\
 
 \ /
  Last update: 2009-04-15 02:35    [W:0.034 / U:10.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site