From: Ian Campbell Subject: Re: Xen PVM: Strange lockups when running PostgreSQL load Date: Thu, 18 Oct 2012 08:48:03 +0100 Message-ID: <1350546483.28188.25.camel@dagon.hellion.org.uk> References: <1350479456-4007-1-git-send-email-stefan.bader@canonical.com> <507EB27D.8050308@citrix.com> <1350482118.2460.74.camel@zakaz.uk.xensource.com> <507ECD06.2050407@canonical.com> <507ED038.8000806@citrix.com> <507FC51102000078000A235E@nat28.tlf.novell.com> <507FC71502000078000A236C@nat28.tlf.novell.com> <507FB1E1.8080700@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <507FB1E1.8080700@canonical.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefan Bader Cc: Andrew Cooper , "xen-devel@lists.xen.org" , Jan Beulich , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Thu, 2012-10-18 at 08:38 +0100, Stefan Bader wrote: > On 18.10.2012 09:08, Jan Beulich wrote: > >>>> On 18.10.12 at 09:00, "Jan Beulich" wrote: > >>>>> On 17.10.12 at 17:35, Andrew Cooper wrote: > >>> In each case, the event channels are masked (no surprise given the > >>> conversation so far on this thread), and have no pending events. > >>> Therefore, I believe we are looking at the same bug. > >> > >> That seems very unlikely (albeit not impossible) to me, given that > >> the non-pvops kernel uses ticket locks while the pvops one doesn't. > > > > And in fact we had a similar problem with our original ticket lock > > implementation, exposed by an open coded lock in the scheduler's > > run queue management. But that was really ticket lock specific, > > in that the fact that a CPU could passively become the owner of > > a lock while polling - that's impossible with pvops' byte locks afaict. > > One of the trains of thought I had was whether it could happen that a cpu is in > polling and the task gets moved. But I don't think it can happen as the > hypercall unlikely is a place where any schedule happens (preempt is none). And > it would be much more common... > > One detail which I hope someone can fill in is the whole "interrupted spinlock" > thing. Saving the last lock pointer stored on the per-cpu lock_spinners and so > on. Is that really only for spinlocks taken without interrupts disabled or do I > miss something there? spinning_lock() returns the old lock which the caller is expected to remember and replace via unspinning_lock() -- it effectively implements a stack of locks which are being waited on. xen_spin_lock_slow (the only caller0 appears to do this correctly from a brief inspection. Is there any chance this is just a simple AB-BA or similar type deadlock? Do we have data which suggests all vCPUs are waiting on the same lock or just that they are waiting on some lock? I suppose lockdep (which I think you mentioned before?) would have caught this, unless pv locks somehow confound it? Ian.