From: Peter Zijlstra <peterz@infradead.org>
To: Matt Turner <mattst88@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-alpha@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: Discrepancy between comments for sched_find_first_bit
Date: Mon, 29 Mar 2010 12:25:02 +0200 [thread overview]
Message-ID: <1269858302.12097.272.camel@laptop> (raw)
In-Reply-To: <b4198de61003282037p502e9fbfi62123088b9d73923@mail.gmail.com>
On Sun, 2010-03-28 at 23:37 -0400, Matt Turner wrote:
> include/asm-generic/bitops/sched.h says
> /*
> * Every architecture must define this function. It's the fastest
> * way of searching a 100-bit bitmap. It's guaranteed that at least
> * one of the 100 bits is cleared.
> */
>
> arch/alpha/include/asm/bitops.h says
> /*
> * Every architecture must define this function. It's the fastest
> * way of searching a 140-bit bitmap where the first 100 bits are
> * unlikely to be set. It's guaranteed that at least one of the 140
> * bits is set.
> */
>
> Is the guarantee that one of the first 100-bits set (and that the last
> 40 are useless?), or 140-bits? If it's just the first 100 bits we care
> about, then the alpha version needs to be fixed.
>
> I'm just checking this out, because gcc produces horrendous code for
> sched_find_first_bit on alpha. I rewrote it in assembly and it's
> better than 4 times faster.
>
> Also, is it even worth optimizing that function? It looks like it's
> only used in kernel/sched_rt.c.
(might help if you CC the scheduler people on scheduler functions :-)
Right, so it used to be 140 bits with the old O(1) scheduler, currently
(as you noted) sched_rt is the only user left and will therefore only
care about the first 100 bits.
As it stands I think it might still make sense to optimize this as for
rt loads it still on a hot path.
As to the 100 vs 140 length, would it really make much of difference to
shorten the implementation to 100? If not I'd leave it at 140.
Ingo, any comments?
next prev parent reply other threads:[~2010-03-29 10:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-29 3:37 Discrepancy between comments for sched_find_first_bit Matt Turner
2010-03-29 10:25 ` Peter Zijlstra [this message]
2010-04-02 20:16 ` Ingo Molnar
2010-04-02 20:50 ` Matt Turner
2010-04-02 21:25 ` Ingo Molnar
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=1269858302.12097.272.camel@laptop \
--to=peterz@infradead.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=mingo@elte.hu \
/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).