netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: wangyun@linux.vnet.ibm.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Avoid extra calculation in ip_route_input_common
Date: Wed, 21 Dec 2011 00:57:58 -0500 (EST)	[thread overview]
Message-ID: <20111221.005758.556186611596801704.davem@davemloft.net> (raw)
In-Reply-To: <4EF16AA3.2070303@linux.vnet.ibm.com>

From: Michael Wang <wangyun@linux.vnet.ibm.com>
Date: Wed, 21 Dec 2011 13:12:03 +0800

> From: Michael Wang <wangyun@linux.vnet.ibm.com>
> 
> If previous condition doesn't meet, the later check will be cancelled.
> So we don't need to do all the calculation.
> 
> Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>

This is intentional to reduce the number of branch prediction
misses, please don't change this.

Once we read one of these values, the rest are incredibly cheap,
the real cost is if we have tons of real branches here, each
of which can be mispredicted.

  parent reply	other threads:[~2011-12-21  5:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21  5:12 [PATCH] Avoid extra calculation in ip_route_input_common Michael Wang
2011-12-21  5:19 ` Michael Wang
2011-12-21  5:23 ` Joe Perches
2011-12-21  5:39   ` Michael Wang
2011-12-21  5:50     ` Joe Perches
2011-12-21  6:00       ` Michael Wang
2011-12-21  5:57 ` David Miller [this message]
2011-12-21  6:04   ` Michael Wang

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=20111221.005758.556186611596801704.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=wangyun@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).