Re: 2.7 thoughts

From: Jamie Lokier
Date: Fri Oct 10 2003 - 10:16:00 EST


William Lee Irwin III wrote:
> You need at least enough warning to get out of critical sections (e.g.
> holding a spinlock) and dump registers out to memory. i.e. as long as it
> takes to schedule out whatever's currently running on the thing.
>
> ... and unless you want to start enforcing realtime bounds, the answer
> to "how long do you have to give the kernel to do it?" is "forever".
> In practice, it won't take forever, but no finite time is enforcible.

You can create a very peculiar scheduling state to make even
spinlocked sections multi-task, so the CPU can be released in a finite
time and quickly - about as quickly as taking an NMI and broadcasting
the critical IPIs to tell other CPUs to take over.

The peculiar state is restored to normal as soon as the number
of concurrent critical sections no longer exceeds the number of real CPUs.

Come to think of it, this would be an excellent HA mechanism: CPU or
node detects hardware fault, raises NMI which saves the CPU registers,
does the IPIs and then immediately disables the CPU. That's _it_.

The peculiar scheduling state obviously slows down the code which is
unlucky enough to be caught in a critical section when a CPU is
removed, so if there is _timing_ critical code it will be affected,
but that is a similar problem to speedstep etc.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/