[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20120807.162750.17030231759163542.davem@davemloft.net>
Date: Tue, 07 Aug 2012 16:27:50 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: bhutchings@...arflare.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] fib: use __fls() on non null argument
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Tue, 07 Aug 2012 22:45:47 +0200
> [PATCH v2 net-next] fib: use __fls() on non null argument
>
> __fls(x) is a bit faster than fls(x), granted we know x is non null.
>
> As Ben Hutchings pointed out, fls(x) = __fls(x) + 1
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Ben Hutchings <bhutchings@...arflare.com>
Applied.
This is, btw, the most expensive part of fib_trie on sparc64 since we
really don't have a universal way to do this in a hardware instruction
and therefore we end up with the branch-heavy software implementation :-/
So if anyone can come up with a way to eliminate this fls() entirely,
you will be my hero.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists