netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: zenczykowski@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net: pfifo_fast - use ffs(x)-1 instead of array lookup
Date: Tue, 13 Mar 2012 00:25:59 -0700 (PDT)	[thread overview]
Message-ID: <20120313.002559.340117447102423900.davem@davemloft.net> (raw)
In-Reply-To: <CAHo-OoyWH9v+D7yJp3sAKnmUEp_DiTeDhmgPme2dGoqWGa2qjg@mail.gmail.com>

From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Tue, 13 Mar 2012 00:23:27 -0700

> I was actually leaning towards going with ffs()-1, since
> 
> it's excellent on x86-64
> good on x86_cmov
> decent on x86
> good on armv5+
> 
> and I'm guessing it'll be good or better on any modern platform

Cycle count it with the pure integer operation variant, I bet it's
within a cycle or two, and at that point we're just splitting hairs
for an ugly-as-sin ifdef.

  reply	other threads:[~2012-03-13  7:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13  5:12 [PATCH] net: pfifo_fast - use ffs(x)-1 instead of array lookup Maciej Żenczykowski
2012-03-13  5:13 ` Maciej Żenczykowski
2012-03-13  5:54 ` David Miller
2012-03-13  7:21   ` Maciej Żenczykowski
2012-03-13  7:23     ` Maciej Żenczykowski
2012-03-13  7:25       ` David Miller [this message]
2012-03-13  7:25     ` David Miller
2012-03-13 11:04 ` David Laight
2012-03-13 16:55   ` David Laight
2012-03-13 17:34     ` Eric Dumazet
2012-03-13 20:37     ` Maciej Żenczykowski

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=20120313.002559.340117447102423900.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=zenczykowski@gmail.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).