Re: [RFC 2/3] zImage: SMP hold
From: Geoff Levand <hidden>
Date: 2007-02-19 15:33:11
Paul Mackerras wrote:
Geoff Levand writes:quoted
+void smp_secondary_hold(unsigned int cpu_id) +{ + while(!smp_secondary_entry) + (void)0;Using a barrier() here rather than making smp_secondary_entry volatile would be better, I think. Also, what's the lifetime of this code after smp_secondary_entry is set, i.e. how do we know the kernel running on the primary cpu will wait for the secondary cpus to have got through this code into the kernel before it reuses this memory for something else?
I was thinking the most (only?) reliably way is to do it from inside the kernel. Once inside, the primary waits for all secondaries to enter before proceeding. That's why I didn't have anything here. There is already a mechanism in the kernel with __secondary_hold_acknowledge, but I don't yet know if it does exactly what is needed. Do you see any trouble with this? -Geoff