Gerd Knorr wrote: > i.e. something like this (as basic idea, patch is far away from doing > anything useful ...)? Adapting $subject to the actual topic, so other lkml readers can catch up ;) Ok, here new version of the SMP alternatives patch. It features: * it actually compiles and boots, so you can start playing with it ;) * reuses the alternatives bits we have already as far as possible. * separate table for the SMP alternatives, so we can keep them and switch at runtime between SMP and UP (for virtual CPU hotplug). * two new alternatives macros, one generic which can handle quite comples stuff such as spinlocks, one for the "lock prefix" case. TODO list: * convert more code (bitops, ...). * module support (using modules is fine, they run the safe SMP version of the code, they just don't benefit from the optimizations yet). * integrate with xen bits and CPU hotplug, at the moment it's a boot-time only thing. * benchmark it. * x86_64 version. * drop the printk's placed into the code for debugging. * probably more ... How it works right now: * The patch switches to UP unconditionally when doing the usual alternatives stuff at boot time * Just before booting the second CPU it switches to SMP. How to test: * boot with "maxcpus=1" to run the UP code. Comments are welcome. cheers, Gerd