User: Password:
Subscribe / Log in / New account

SMP alternatives

SMP alternatives

Posted Dec 15, 2005 14:05 UTC (Thu) by kpfleming (subscriber, #23250)
In reply to: SMP alternatives by dw
Parent article: SMP alternatives

You are confusing mutual exclusion/semaphore locks with 'bus' locks. There is no 'unlock' operation involved here; the 'lock' prefix instruction being referred to only affects the instruction it precedes, and there is an automatic 'unlock' of the bus when that instruction completes.

Switching from uni- to multi-processor mode won't even require holding all the kernel threads/processes in an idle state while this happens, it would just have to complete all the instruction patching before any threads could be allowed to run on the new CPU.

This is a very, very cool idea :-)

(Log in to post comments)

SMP alternatives

Posted Dec 15, 2005 18:39 UTC (Thu) by Ross (guest, #4065) [Link]

That's not how I read it.

"The main use of SMP alternatives in his patch is with spinlock operations; spinlocks can be patched in or edited out, as dictated by the configuration of the system at boot time."

It sounds like spinlocks will be turned into noops. This may be ok when going SMP->UP, but maybe not the other direction, and I wonder what kind of lock state would be retained when going SMP->UP->SMP...

SMP alternatives

Posted Dec 15, 2005 18:59 UTC (Thu) by jzbiciak (subscriber, #5246) [Link]

To enable hotplug SMP -> UP -> SMP, you'd definitely need to retain spinlocks, or at least put a lightweight "take lock" instruction there as opposed to the full spin. Fully NOPping spinlocks out would be a disaster, as you note.

Elsewhere, though, you could nuke/replace LOCK prefixes as needed.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds