netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Anton Blanchard <anton@samba.org>
Cc: Jan-Bernd Themann <ossthema@de.ibm.com>,
	netdev <netdev@vger.kernel.org>,
	linux-ppc <linuxppc-dev@ozlabs.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Marcus Eder <meder@de.ibm.com>,
	Christoph Raisch <raisch@de.ibm.com>,
	Thomas Klein <tklein@de.ibm.com>
Subject: Re: [PATCH 1/6] ehea: interface to network stack
Date: Mon, 14 Aug 2006 13:26:56 +0200	[thread overview]
Message-ID: <20060814112656.GC10164@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20060811205624.GE479@krispykreme>

On Sat, 12 August 2006 06:56:24 +1000, Anton Blanchard wrote:
> 
> > +
> > +				skb_index = ((index - i
> > +					      + port_res->skb_arr_sq_len)
> > +					     % port_res->skb_arr_sq_len);
> 
> This is going to force an expensive divide. Its much better to change
> this to the simpler and quicker:
> 
> i++;
> if (i > max)
> 	i = 0;

Is a conditional cheaper than a divide?  In case of a misprediction I
would assume it to be significantly slower and I don't know the ratio
of mispredictions for this branch.

Jörn

-- 
Victory in war is not repetitious.
-- Sun Tzu

  reply	other threads:[~2006-08-14 11:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09  8:38 [PATCH 1/6] ehea: interface to network stack Jan-Bernd Themann
2006-08-09  9:08 ` Christian Borntraeger
2006-08-11 11:02   ` Jan-Bernd Themann
2006-08-09 13:06 ` Alexey Dobriyan
2006-08-10 14:49   ` Jan-Bernd Themann
2006-08-10  6:15 ` Michael Ellerman
2006-08-10  7:30   ` Michael Ellerman
2006-08-10 14:28   ` Jan-Bernd Themann
2006-08-11 20:56 ` Anton Blanchard
2006-08-14 11:26   ` Jörn Engel [this message]
2006-08-14 14:38     ` Anton Blanchard
2006-08-14 15:43       ` Jan-Bernd Themann
2006-08-14 16:59         ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2006-06-21 12:40 Jan-Bernd Themann

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=20060814112656.GC10164@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=meder@de.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=ossthema@de.ibm.com \
    --cc=raisch@de.ibm.com \
    --cc=tklein@de.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).