This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


RE: [Xen-devel] [PATCH] Yield to VCPU hcall, spinlock yielding

xen-devel-bounces@xxxxxxxxxxxxxxxxxxx wrote on 06/07/2005 06:38:14 AM:

> Orran,
> Are you assuming the pre-emption notification is going to get propagated
> to user-space as a signal, and that user space applications would be
> modified to take advantage of the signal? (possibly this could be hidden
> in the pthread library?} Since the kernel doesn't know when user space
> has an application lock or not, that's going to be a lot of signals.

Nope, we reviewed a couple of alternatives for notification to user level and for now are not persuing any of them.  The pre-emption notification goes to the kernel, and its an OS specific thing what it chooses to do with it. Our current plan in Linux is to run a high priority thread in the kernel which makes a hypervisor call to yield back the processor. Hence, the application thread context is not hidden in the hypervisor, but the application thread is marked by linux as ready to run.  Now if the thread is a high priority thread holding an application lock normal linux mechanisms will cause it to be scheduled on some other processor.  Without the preemption notification, or if we yield back at interrupt level, the application thread register state is buried in the hypervisor, and of course the thread appears to Linux to be running...

Everything seems to just fall out nicely in Linux as long as we make the call back on a kernel thread. Different OSes, of course, will have different techniques they can use given a notification of an attempt to preempt.

    -- Orran
Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>