From: Wu Fengguang <fengguang.wu@intel.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] readahead: remove redundant test in shrink_readahead_size_eio()
Date: Wed, 15 Apr 2009 08:31:46 +0800 [thread overview]
Message-ID: <20090415003145.GA5737@localhost> (raw)
In-Reply-To: <1239726034.32203.129.camel@localhost>
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
prev parent reply other threads:[~2009-04-15 0:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-14 1:37 [PATCH] readahead: remove redundant test in shrink_readahead_size_eio() Wu Fengguang
[not found] ` <1239726034.32203.129.camel@localhost>
2009-04-15 0:31 ` Wu Fengguang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090415003145.GA5737@localhost \
--to=fengguang.wu@intel.com \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox