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

Re: [Xen-devel] [PATCH 3/9] xen: sched: make locking for {insert, remove}_vcpu consistent



On Fri, 2015-10-09 at 14:05 +0100, Andrew Cooper wrote:
> On 08/10/15 21:39, Dario Faggioli wrote:
> > On Thu, 2015-10-08 at 16:20 +0100, Andrew Cooper wrote:

> > > On 08/10/15 15:58, George Dunlap wrote:
> > > > Generic scheduling code is called from interrupt contexts --
> > > > namely,
> > > > vcpu_wake()
> > > There are a lot of codepaths, but I cant see one which is
> > > definitely
> > > called with interrupts disables.  (OTOH, I can see several where
> > > interrupts are definitely enabled).
> > > 
> > Sorry, it's certainly me, but I don't think I understand this.
> > 
> > AFAICT, you are saying that you fail to find in the code,
> > situations
> > the scheduler code is invoked, with interrupts already disabled, is
> > this correct? In particular "definitely called with interrupt
> > disabled"
> > is what confuses me... :-/
> 
> Given a brief look at the code, I can't spot a codepath where it is
> obvious that interrupts are disabled.
> 
Ok, thanks for rephrasing it (and for bearing with me :-).

> > Also (assuming what I just said is what you meant), are you
> > referring
> > "just" to schedule(), or even to other scheduler's code, which also
> > disables interrupt when taking the lock(s) it needs, like, e.g.,
> > vcpu_wake() as George said?
> 
> I was looking on callchains involving vcpu_wake().
> 
Ok, thanks for clarifying this too.

AFAIUI for now, the issue is more whether we are in interrupt context,
rather than whether or not interrupt are disabled already. That is,
whether or not, by not deactivating interrupt when taking the
{v,p}cpu_schedule_lock(), we can deadlock a pCPU (and, in case that can
happen, how to avoid that).

Anyway, I think this is interesting (it is for me, at least :-)) and
worthwhile enough to investigate a bit more.

I'll dig and report.

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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