On Mon, 2005-12-19 at 14:40 +1100, Ian Wienand wrote:
> Mostly I think the sub-architecture is passed via different flags to
> gcc, which can try to optimise the code. Talking with people from SGI
> who look into that sort of thing, the benefits of even a much better
> compiler fall into noise compared to things like lock contention.
Right. Which is what I've found too. Which led me to wondering: Jeff:
how do you plan to do this UP/SMP kernel efficiently? The kernel
implements spin_lock as a macro that gets compiled out when building for
UP:
/*
* If CONFIG_SMP is unset, declare the _raw_* definitions as nops
*/
#define spin_lock_init(lock) do { (void)(lock); } while(0)
#define _raw_spin_lock(lock) do { (void)(lock); } while(0)
(from include/linux/spinlock.h on 2.6.10)
(the first line is not so exciting, but the second one is pretty
important).
The corresponding code for when CONFIG_SMP is set actually implements a
spin lock, along with all the consequences you'd expect.
Does Ubuntu have a magical solution to this, or do you just execute the
extra code on UP?
Yours,
Curious in Woolloomoolloo.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html