From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: Deadload between sched_adjust() in schedule.c and compat_failsafe_callback in entry.S Date: Wed, 08 Apr 2009 07:03:59 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0968681005==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: hj lee , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --===============0968681005== Content-type: multipart/alternative; boundary="B_3322019043_16450615" > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3322019043_16450615 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable This should be easily fixable. I=B9ll look into it. -- Keir On 08/04/2009 06:41, "hj lee" wrote: > We have a deadlock in dom0 running X86_64 CentOs 5.2 when dom0 runs libvi= rtd > and xentop together, this deadlock is easily reproducible. The dom0 has f= our > vcpus assigned. The libvirt is running on vcpu#0 and xentop is running on > vcpu#3. The vcpu#0 is processing XEN_DOMCTL_scheduler_op of domctl.c whic= h > calls sched_adjust(). The sched_adjust() calls vcpu_pause(v) for each vcp= u in > the domain, and vcpu_pause(v) calls vcpu_sleep_sync(v) where it waits for > vcpu#3 pause. On the other hand vcpu#3 is executing vcpu_runstate_get() i= n > schedule.c called from XEN_SYSCTL_getdomaininfolist in sysctl.c. At the t= ime > of deadlock somehow this vcpu#3's exception RIP is pointing > [compat_failsafe_callback+86], which is cmpb $0x0,87987(%rip)=A0=A0=A0 # > 0xffff828c8019ef00 . I am not sure how vcpu#3 gets int= o > this code, but what I believe it is trying to get the spinlock on domctl_= lock. > But vcpu#0 had a lock on the domctl_lock when it enters do_comctl(). So t= wo > vcpus are in deadlock. >=20 > Can anybody explain how and when compat_failsafe_callback in entry.S is g= et > called? Why does it try to get a lock on domctl_lock? --B_3322019043_16450615 Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Re: [Xen-devel] Deadload between sched_adjust() in schedule.c and co= mpat_failsafe_callback in entry.S This should be easily fixable. I’ll look into it.

 -- Keir

On 08/04/2009 06:41, "hj lee" <ker= dosa@gmail.com> wrote:

<= SPAN STYLE=3D'font-size:11pt'>We have a deadlock in dom0 running X86_64 CentOs= 5.2 when dom0 runs libvirtd and xentop together, this deadlock is easily re= producible. The dom0 has four vcpus assigned. The libvirt is running on vcpu= #0 and xentop is running on vcpu#3. The vcpu#0 is processing XEN_DOMCTL_sche= duler_op of domctl.c which calls sched_adjust(). The sched_adjust() calls vc= pu_pause(v) for each vcpu in the domain, and vcpu_pause(v) calls vcpu_sleep_= sync(v) where it waits for vcpu#3 pause. On the other hand vcpu#3 is executi= ng vcpu_runstate_get() in schedule.c called from XEN_SYSCTL_getdomaininfolis= t in sysctl.c. At the time of deadlock somehow this vcpu#3's exception RIP i= s pointing [compat_failsafe_callback+86], which is cmpb $0x0,87987(%rip)=A0=A0=A0 = # 0xffff828c8019ef00 <domctl_lock.10183>. I am not sure how vcpu#3 get= s into this code, but what I believe it is trying to get the spinlock on dom= ctl_lock. But vcpu#0 had a lock on the domctl_lock when it enters do_comctl(= ). So two vcpus are in deadlock.

Can anybody explain how and when compat_failsafe_callback in entry.S is get= called? Why does it try to get a lock on domctl_lock?
--B_3322019043_16450615-- --===============0968681005== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0968681005==--