xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Subject: Re: [PATCH 5/7] xen: sched: get rid of the per domain vCPU list in Credit2
Date: Thu, 8 Oct 2015 17:32:45 +0200	[thread overview]
Message-ID: <1444318365.22254.29.camel@citrix.com> (raw)
In-Reply-To: <56167628.6050400@citrix.com>


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

On Thu, 2015-10-08 at 14:56 +0100, Andrew Cooper wrote:
> On 08/10/15 13:53, Dario Faggioli wrote:
> > @@ -1443,7 +1433,7 @@ csched2_dom_cntl(
> >  
> >          if ( op->u.credit2.weight != 0 )
> >          {
> > -            struct list_head *iter;
> > +            struct vcpu *vc;
> 
> Any chance of starting to align on the more common practice of just v
> for a vcpu?
> 
I see. I'm a bit split, though. It's v in schedule.c, but it's
**always** (with only 2 exceptions) vc in sched_*.c.

I know that, if we want to align, we need to start from somewhere, but
OTOH, consistency is rather helpful when reading this code.

I'll think about it...

> > @@ -1539,9 +1528,7 @@ csched2_free_domdata(const struct scheduler
> > *ops, void *data)
> >  static void
> >  csched2_dom_destroy(const struct scheduler *ops, struct domain
> > *dom)
> >  {
> > -    struct csched2_dom *sdom = CSCHED2_DOM(dom);
> > -
> > -    BUG_ON(!list_empty(&sdom->vcpu));
> > +    BUG_ON(CSCHED2_DOM(dom)->nr_vcpus != 0);
> 
> This is a latent bug (excuse the pun) which can be triggered by
> userspace.  There is no guarantee or requirement that a domain
> registered with a scheduler has vcpus.
> 
Mmm... I think the original check wanted to catch cases where a domain
(or, at least, its scheduling related bits) is being destroyed with
vcpus still on.

While trying to retain the BUG_ON, even with sdom->vcpu not being there
any longer, I probably went too far.

 BUG_ON(CSCHED2_DOM(dom)->nr_vcpus > 0);

should be fine, I think.

Thanks and 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-10-08 15:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 12:52 [PATCH 0/7] xen: sched: fix locking of {insert, remove}_vcpu() Dario Faggioli
2015-10-08 12:52 ` [PATCH 1/7] xen: sched: fix locking of remove_vcpu() in credit1 Dario Faggioli
2015-10-08 13:16   ` Andrew Cooper
2015-10-08 12:52 ` [PATCH 2/7] xen: sched: fix locking for insert_vcpu() in credit1 and RTDS Dario Faggioli
2015-10-08 13:18   ` Andrew Cooper
2015-10-08 15:16   ` George Dunlap
2015-10-08 15:49     ` Dario Faggioli
2015-10-08 20:12       ` Dario Faggioli
2015-10-08 12:52 ` [PATCH 3/7] xen: sched: better handle (not) inserting idle vCPUs in runqueues Dario Faggioli
2015-10-08 15:27   ` George Dunlap
2015-10-08 15:39     ` Dario Faggioli
2015-10-09  5:31   ` Juergen Gross
2015-10-08 12:52 ` [PATCH 4/7] xen: sched: get rid of the per domain vCPU list in RTDS Dario Faggioli
2015-10-08 13:47   ` Andrew Cooper
2015-10-08 15:31   ` George Dunlap
2015-10-08 12:53 ` [PATCH 5/7] xen: sched: get rid of the per domain vCPU list in Credit2 Dario Faggioli
2015-10-08 13:10   ` Andrew Cooper
2015-10-08 13:17     ` Dario Faggioli
2015-10-08 13:56   ` Andrew Cooper
2015-10-08 15:32     ` Dario Faggioli [this message]
2015-10-08 15:39       ` Andrew Cooper
2015-10-08 15:40   ` George Dunlap
2015-10-08 12:53 ` [PATCH 6/7] xen: sched: fix an 'off by one \t' in credit2 debug dump Dario Faggioli
2015-10-08 15:42   ` George Dunlap
2015-10-08 15:59     ` Dario Faggioli
2015-10-08 12:53 ` [PATCH 7/7] xen: sched / cpupool: dump the actual value of NOW() Dario Faggioli
2015-10-08 13:12   ` Andrew Cooper
2015-10-08 15:37     ` Jan Beulich
2015-10-09  5:09   ` Juergen Gross

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=1444318365.22254.29.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).