lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Wed, 15 Apr 2009 08:31:46 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [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@...el.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ