All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Meng Xu <xumengpanda@gmail.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Meng Xu <mengxu@cis.upenn.edu>, Jan Beulich <JBeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v3 2/6] xen: sched: fix locking for insert_vcpu() in credit1 and RTDS
Date: Mon, 2 Nov 2015 09:03:45 +0100	[thread overview]
Message-ID: <1446451425.2750.3.camel@citrix.com> (raw)
In-Reply-To: <CAENZ-+nJ_=f_7mFCjeNfMbEVR9Tp4JCYP072wOxUzT9mjxWmXg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2158 bytes --]

On Fri, 2015-10-30 at 19:00 -0400, Meng Xu wrote:
> Hi Dario,
>
Hi,

> > This is fixed as follows:
> >  - take the lock in the hook implementations, in specific
> >    schedulers' code;
> >  - avoid calling insert_vcpu(), for the idle vCPU, in
> >    schedule_cpu_switch(). In fact, idle vCPUs are set to run
> >    immediately, and the various schedulers won't insert them
> >    in their runqueues anyway, even when explicitly asked to.
> > 
> > While there, still in schedule_cpu_switch(), locking with
> > _irq() is enough (there's no need to do *_irqsave()).
> > 
> > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> > ---

> > diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
> > index 6f71e0d..e16bd3a 100644
> > --- a/xen/common/sched_credit.c
> > +++ b/xen/common/sched_credit.c
> > @@ -903,10 +903,16 @@ static void
> >  csched_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
> >  {
> >      struct csched_vcpu *svc = vc->sched_priv;
> > +    spinlock_t *lock;
> > +    unsigned long flags;
> > +
> > +    lock = vcpu_schedule_lock_irqsave(vc, &flags);
> 
> 
> This is inconsistent with the commit log.
>
Mmm... no, the changelog speaks about schedule_cpu_switch(), not this
functions.

For this function, the conversion from _irqsave() to _irq() is done
later in the series, when the call to insert_vcpu() is removed from the
boot path, and hence does not require IRQs to be disabled when called
(and the changelog of that later patch explains this).

> I also checked the
> 
> branch rel/sched/fix-vcpu-ins-rem-v2 in your repo., it is the
> following code:
> 
> lock = vcpu_schedule_lock_irq(vc, &flags);
> 
> I guess maybe you forgot to change it in this commit but change it
> the
> following commit?
> 
No, this is one of the few thing that changed between v2 and v3.

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 #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2015-11-02  8:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 23:04 [PATCH v3 0/6] xen: sched: fix locking of {insert, remove}_vcpu() Dario Faggioli
2015-10-29 23:04 ` [PATCH v3 1/6] xen: sched: fix locking of remove_vcpu() in credit1 Dario Faggioli
2015-11-02 18:04   ` George Dunlap
2015-11-03 17:15     ` Dario Faggioli
2015-10-29 23:04 ` [PATCH v3 2/6] xen: sched: fix locking for insert_vcpu() in credit1 and RTDS Dario Faggioli
2015-10-30 23:00   ` Meng Xu
2015-11-02  8:03     ` Dario Faggioli [this message]
2015-11-02 14:45       ` Meng Xu
2015-11-04 14:12         ` Dario Faggioli
2015-11-04 15:01           ` Meng Xu
2015-11-04 15:52             ` Dario Faggioli
2015-11-05  3:55               ` Meng Xu
2015-10-29 23:04 ` [PATCH v3 3/6] xen: sched: clarify use cases of schedule_cpu_switch() Dario Faggioli
2015-10-29 23:59   ` Dario Faggioli
2015-10-30  4:33     ` Juergen Gross
2015-11-02 18:23   ` George Dunlap
2015-10-29 23:04 ` [PATCH v3 4/6] xen: sched: better handle (not) inserting idle vCPUs in runqueues Dario Faggioli
2015-10-29 23:04 ` [PATCH v3 5/6] xen: sched: get rid of the per domain vCPU list in RTDS Dario Faggioli
2015-11-02 18:57   ` George Dunlap
2015-10-29 23:04 ` [PATCH v3 6/6] xen: sched: get rid of the per domain vCPU list in Credit2 Dario Faggioli
2015-11-02 18:56   ` George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446451425.2750.3.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=mengxu@cis.upenn.edu \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xumengpanda@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.