[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] yield hypercall to prevent lock holder problem ?

Hi, George:

Thanks for your reply! ÂI'll dig into the code.


On Tue, Apr 2, 2013 at 5:57 AM, George Dunlap <dunlapg@xxxxxxxxx> wrote:
On Fri, Mar 29, 2013 at 9:43 PM, Sisu Xi <xisisu@xxxxxxxxx> wrote:
> Hi, all:
> Does anyone know how does the yield function works in the Xen scheduler?
> Right now only credit scheduler uses it to put it behind one lower-priority
> runnable vcpus. But what is this used for?
> I checked [1], the author also mentioned the yield function to prevent lhp.
> Is this the same function?
> On Xen part, the yield function is called in do_yield(), which is called in
> do_sched_op(), by passing in SCHEDOP_YIELD.
> However, if you grep the whole Linux Kernel Code, (3.8.0 in my case), the
> place where SCHEDOP_YIELD appears are:
> 1) drivers\tty\hvc\hvc_xen.c, domU_write_console()
> 2) arch\x86\xen\smp.c, xen_cpu_up()
> 3) arch\x86\xen\smp.c, xen_smp_send_call_function_ipi()
> 4) arch\ia64\xen\xcom_hcall.c, xencomm_hypercall_sched_op()
> None of this seems related to the spinlock.

YIELD is used by the Citrix Windows PV drivers to patch Windows
spinlocks. ÂThe pvops kernels have a different solution to the
lock-holder problem that's a bit more complicated. Â But the
lock-holder problem isn't limited only to actual locks; it's a
potential problem any time any cpu waits on another cpu. ÂI haven't
looked at the code, but in the case of #3, the caller spins waiting
for the other cpu to execute the function; the basic problem is the
same as the spinlock problem. ÂI suspect if you look at the other 3,
you'll also find someone spinning while waiting for another cpu.


Sisu Xi, PhD Candidate

Department of Computer Science and Engineering
Campus Box 1045
Washington University in St. Louis
One Brookings Drive
St. Louis, MO 63130
Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.