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

Hi,

Anton Blanchard wrote:
>> 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.
> 
> A quick scan of the web shows 40 cycles for athlon64 idiv, and its
> similarly slow on many other cpus. Even assuming you mispredict every
> branch its going to be a win.
> 
> Anton

as our queue size is always a power of 2, we simply use:
i++;
i &= (ringbufferlength - 1)

So we can get along without the if.

Jan-Bernd

WARNING: multiple messages have this Message-ID (diff)
From: Jan-Bernd Themann <ossthema@de.ibm.com>
To: Anton Blanchard <anton@samba.org>
Cc: "Jörn Engel" <joern@wohnheim.fh-wedel.de>,
	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 17:43:21 +0200	[thread overview]
Message-ID: <44E09A19.9050205@de.ibm.com> (raw)
In-Reply-To: <20060814143842.GM479@krispykreme>

Hi,

Anton Blanchard wrote:
>> 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.
> 
> A quick scan of the web shows 40 cycles for athlon64 idiv, and its
> similarly slow on many other cpus. Even assuming you mispredict every
> branch its going to be a win.
> 
> Anton

as our queue size is always a power of 2, we simply use:
i++;
i &= (ringbufferlength - 1)

So we can get along without the if.

Jan-Bernd



  reply	other threads:[~2006-08-14 16:22 UTC|newest]

Thread overview: 26+ 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  8:38 ` Jan-Bernd Themann
2006-08-09  9:08 ` Christian Borntraeger
2006-08-09  9:08   ` Christian Borntraeger
2006-08-11 11:02   ` Jan-Bernd Themann
2006-08-11 11:02     ` Jan-Bernd Themann
2006-08-09 13:06 ` Alexey Dobriyan
2006-08-09 13:06   ` Alexey Dobriyan
2006-08-10 14:49   ` Jan-Bernd Themann
2006-08-10 14:49     ` Jan-Bernd Themann
2006-08-10  6:15 ` Michael Ellerman
2006-08-10  6:15   ` Michael Ellerman
2006-08-10  7:30   ` Michael Ellerman
2006-08-10 14:28   ` Jan-Bernd Themann
2006-08-10 14:28     ` Jan-Bernd Themann
2006-08-11 20:56 ` Anton Blanchard
2006-08-11 20:56   ` Anton Blanchard
2006-08-14 11:26   ` Jörn Engel
2006-08-14 11:26     ` Jörn Engel
2006-08-14 14:38     ` Anton Blanchard
2006-08-14 14:38       ` Anton Blanchard
2006-08-14 15:43       ` Jan-Bernd Themann [this message]
2006-08-14 15:43         ` Jan-Bernd Themann
2006-08-14 16:59         ` Arnd Bergmann
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=44E09A19.9050205@de.ibm.com \
    --to=ossthema@de.ibm.com \
    --cc=anton@samba.org \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=meder@de.ibm.com \
    --cc=netdev@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.