From: Willy Tarreau <willy@w.ods.org>
To: "David S. Miller" <davem@redhat.com>
Cc: willy@w.ods.org, scrosby@cs.rice.edu,
alexander.riesen@synopsys.COM, linux-kernel@vger.kernel.org,
marcelo@conectiva.com.br
Subject: Re: Algoritmic Complexity Attacks and 2.4.20 the dcache code
Date: Sat, 31 May 2003 10:56:12 +0200 [thread overview]
Message-ID: <20030531085612.GE21673@alpha.home.local> (raw)
In-Reply-To: <20030531.011210.34750891.davem@redhat.com>
On Sat, May 31, 2003 at 01:12:10AM -0700, David S. Miller wrote:
> From: Willy TARREAU <willy@w.ods.org>
> Date: Sat, 31 May 2003 10:02:05 +0200
>
> With this simple change, jhash_mix is *exactly* three times faster
> for me on athlon-xp, whatever gcc I use (2.95.3 or 3.2.3), on the
> following do_hash() function, and about 40% faster when used on
> local variables.
>
> Interesting :-)
Not that much finally, because I cannot reproduce the slowdown I initially
observed with the original function on local variables. I think I may have
had a wrong type somewhere or a particular operation which prevented gcc
from fully optimizing the macro :-/
So at the moment, both the original and my version are the same speed on
local variables on athlon-xp.
BTW, I don't understand why, but I've just noticed that the Alpha is 25%
slower on my version when used on local variables !
So my version is only interesting when working on indirect variables, which
is never the case in the kernel... Never mind, that was just a try.
For info, here's what I measure here on the original version :
- athlon-xp : 24 cycles, whatever -march/-mcpu
- alpha ev6 : -mcpu=ev5 : 22 cycles
-mcpu=ev6 : 24 cycles
- sparc64 : default : 26 cycles
-mcpu=v9 : 24 cycles
-mcpu=ultrasparc: 19 cycles (18 cycles for my version here)
Considering that the Alpha and the UltraSparc can issue up to 4 instruction
per cycle, I wonder whether it would be worse trying to implement such a hash
in assembler, optimized for each processor, with a default fall-back to the
C function for archs that have not been implemented.
Cheers,
Willy
next prev parent reply other threads:[~2003-05-31 8:43 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-29 20:42 Scott A Crosby
2003-05-30 3:57 ` David S. Miller
2003-05-30 4:29 ` Ingo Molnar
2003-05-30 18:16 ` Timothy Miller
2003-05-30 18:53 ` Scott A Crosby
2003-05-30 5:04 ` Scott A Crosby
2003-05-30 6:24 ` David S. Miller
2003-05-30 6:46 ` Scott A Crosby
2003-05-30 6:56 ` David S. Miller
2003-05-30 8:59 ` Alex Riesen
2003-05-30 9:00 ` David S. Miller
2003-05-30 15:05 ` Scott A Crosby
2003-05-31 6:18 ` David S. Miller
2003-05-31 8:02 ` Willy TARREAU
2003-05-31 8:12 ` David S. Miller
2003-05-31 8:56 ` Willy Tarreau [this message]
2003-05-31 8:58 ` David S. Miller
2003-05-31 8:58 ` David Schwartz
2003-05-31 9:01 ` David S. Miller
2003-05-31 6:30 ` William Lee Irwin III
2003-05-31 6:33 ` David S. Miller
2003-05-31 6:41 ` William Lee Irwin III
2003-05-31 6:45 ` David S. Miller
2003-05-31 18:40 ` Aaron Lehmann
2003-05-30 4:02 ` Ingo Molnar
2003-05-30 4:42 ` Scott A Crosby
2003-05-30 5:01 ` David S. Miller
2003-05-30 13:48 ` Nikita Danilov
2003-06-01 1:15 ` Daniel Phillips
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=20030531085612.GE21673@alpha.home.local \
--to=willy@w.ods.org \
--cc=alexander.riesen@synopsys.COM \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=scrosby@cs.rice.edu \
/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
all inboxes | Powered by JetHome®