From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
Ingo Molnar <mingo@elte.hu>, Andrew Morton <akpm@osdl.org>,
LKML <linux-kernel@vger.kernel.org>,
Daniel Walker <dwalker@mvista.com>
Subject: Re: [PATCH] speed up on find_first_bit for i386 (let compiler do the work)
Date: Thu, 28 Jul 2005 11:47:19 -0400 [thread overview]
Message-ID: <1122565640.29823.242.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.58.0507280823210.3227@g5.osdl.org>
On Thu, 2005-07-28 at 08:30 -0700, Linus Torvalds wrote:
>
> I suspect the old "rep scas" has always been slower than
> compiler-generated code, at least under your test conditions. Many of the
> old asm's are actually _very_ old, and some of them come from pre-0.01
> days and are more about me learning the i386 (and gcc inline asm).
I've been playing with different approaches, (still all hot cache
though), and inspecting the generated code. It's not that the gcc
generated code is always better for the normal case. But since it sees
more and everything is not hidden in asm, it can optimise what is being
used, and how it's used.
>
> That said, I don't much like your benchmarking methodology. I suspect that
> quite often, the code in question runs from L2 cache, not in a tight loop,
> and so that "run a million times" approach is not necessarily the best
> one.
Well, I never said I was a test benchmark writer :-). If you know of a
better way to benchmark these, then let me know. I also thought that
having all in a hot cache could help with showing the differences. But
I guess I would need to test this in other ways.
>
> I'll apply this one as obvious: I doubt the compiler generates bigger code
> or has any real downsides, but I just wanted to say that in general I just
> wish people didn't always time the hot-cache case ;)
I've just finished a version of find_first_zero_bit too. It has the
same comparisons as the find_first_bit but not as drastic. Do you want
this too, and if so, as a separate patch on top of the first one, or
against 2.6.12.2 (that's the kernel I'm working with right now) or do
you want me to submit a new patch with both changes?
-- Steve
next prev parent reply other threads:[~2005-07-28 16:02 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-27 14:13 [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable Steven Rostedt
2005-07-27 14:17 ` Ingo Molnar
2005-07-27 14:26 ` Steven Rostedt
2005-07-27 14:33 ` Ingo Molnar
2005-07-27 14:47 ` [PATCH] safty check of MAX_RT_PRIO >= MAX_USER_RT_PRIO Steven Rostedt
2005-07-27 15:05 ` Steven Rostedt
2005-07-27 18:52 ` Ingo Molnar
2005-07-27 14:53 ` [RFC][PATCH] Make MAX_RT_PRIO and MAX_USER_RT_PRIO configurable Esben Nielsen
2005-07-27 15:02 ` Steven Rostedt
2005-07-27 16:09 ` K.R. Foley
2005-07-27 17:01 ` Esben Nielsen
2005-07-27 17:25 ` Steven Rostedt
2005-07-27 21:32 ` Esben Nielsen
2005-07-28 12:17 ` Steven Rostedt
2005-07-28 7:22 ` Ingo Molnar
2005-07-28 11:53 ` Steven Rostedt
2005-07-27 17:42 ` K.R. Foley
2005-07-28 9:59 ` Esben Nielsen
2005-07-27 14:28 ` Steven Rostedt
2005-07-27 14:38 ` Ingo Molnar
2005-07-27 14:46 ` Steven Rostedt
2005-07-28 7:33 ` Ingo Molnar
2005-07-28 1:42 ` Matt Mackall
2005-07-28 1:00 ` Daniel Walker
2005-07-28 1:20 ` Lee Revell
2005-07-28 1:26 ` Steven Rostedt
2005-07-28 1:25 ` Steven Rostedt
2005-07-28 3:06 ` Steven Rostedt
2005-07-28 3:32 ` Steven Rostedt
2005-07-28 3:45 ` Steven Rostedt
2005-07-28 3:51 ` Nick Piggin
2005-07-28 11:43 ` [PATCH] speed up on find_first_bit for i386 (let compiler do the work) Steven Rostedt
2005-07-28 12:45 ` Steven Rostedt
2005-07-28 15:31 ` Linus Torvalds
2005-07-28 15:30 ` Linus Torvalds
2005-07-28 15:47 ` Steven Rostedt [this message]
2005-07-28 16:34 ` Maciej W. Rozycki
2005-07-28 16:57 ` Steven Rostedt
2005-07-28 17:25 ` Linus Torvalds
2005-07-29 10:03 ` David Woodhouse
2005-07-29 14:41 ` Maciej W. Rozycki
2005-07-29 16:23 ` Linus Torvalds
2005-07-29 14:39 ` Maciej W. Rozycki
2005-07-29 16:29 ` Linus Torvalds
2005-07-29 17:14 ` Maciej W. Rozycki
2005-07-28 17:17 ` Linus Torvalds
2005-07-29 15:09 ` Maciej W. Rozycki
2005-07-28 18:25 ` Steven Rostedt
2005-07-28 18:56 ` Linus Torvalds
2005-07-28 17:52 ` Mitchell Blank Jr
2005-07-29 14:37 linux
2005-07-29 15:08 ` linux-os (Dick Johnson)
2005-07-31 16:33 Richard Kennedy
2005-08-01 2:00 linux
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=1122565640.29823.242.camel@localhost.localdomain \
--to=rostedt@goodmis.org \
--cc=akpm@osdl.org \
--cc=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=torvalds@osdl.org \
/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
Powered by JetHome