xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2 1/2] xen: sched: don't call hooks of the wrong scheduler via VCPU2OP
Date: Fri, 17 Mar 2017 19:27:31 +0100	[thread overview]
Message-ID: <166ce2a1-6596-6d39-47c5-52d791c8051a@suse.com> (raw)
In-Reply-To: <148977477739.22479.7043154591081622447.stgit@Palanthas.fritz.box>

On 17/03/17 19:19, Dario Faggioli wrote:
> Within context_saved(), we call the context_saved hook,
> and we use VCPU2OP() to determine from what scheduler.
> VCPU2OP uses DOM2OP, which uses d->cpupool, which is
> NULL when d is the idle domain. And in that case,
> DOM2OP just returns ops, the scheduler of cpupool0.
> 
> Therefore, if:
> - cpupool0's scheduler defines context_saved (like
>   Credit2 and RTDS do),
> - we are not in cpupool0 (i.e., our scheduler is
>   not ops),
> - we are context switching from idle,
> 
> we call VCPU2OP(idle_vcpu), which means
> DOM2OP(idle->cpupool), which is ops.
> 
> Therefore, we both:
> - check if context_saved is defined in the wrong
>   scheduler;
> - if yes, call the wrong one.
> 
> When using Credit2 at boot, and also Credit2 in
> the other cpupool, this is wrong but innocuous,
> because it only involves the idle vcpus.
> 
> When using Credit2 at boot, and Credit1 in the
> other cpupool, this is *totally* wrong, and
> it's by chance it does not explode!
> 
> When using Credit2 and other schedulers I'm
> developping, I hit the following assert (in
> sched_credit2.c, on a CPU inside a cpupool that
> does not use Credit2):
> 
> csched2_context_saved()
> {
>  ...
>  ASSERT(!vcpu_on_runq(svc));
>  ...
> }
> 
> Fix this by dealing explicitly, in VCPU2OP, with
> idle vcpus, returning the scheduler of the pCPU
> they (always) run on.
> 
> While there, rename VCPU2OP itself to something
> that makes it easier to understand what it does.
> 
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


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

  reply	other threads:[~2017-03-17 18:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 18:19 [PATCH v2 0/2] xen: sched: don't call hooks of the wrong scheduler via VCPU2OP Dario Faggioli
2017-03-17 18:19 ` [PATCH v2 1/2] " Dario Faggioli
2017-03-17 18:27   ` Juergen Gross [this message]
2017-03-17 18:29   ` Juergen Gross
2017-03-20  8:01     ` Jan Beulich
2017-03-27 11:48   ` George Dunlap
2017-03-27 11:49   ` George Dunlap
2017-03-27 15:07     ` Dario Faggioli
2017-03-17 18:19 ` [PATCH v2 2/2] xen: sched: improve robustness (and rename) DOM2OP() Dario Faggioli
2017-03-27 13:23   ` George Dunlap
2017-03-27 15:13     ` Dario Faggioli
2017-04-06 10:59     ` Dario Faggioli
2017-04-06 11:06       ` Juergen Gross
2017-04-07  0:31         ` Dario Faggioli

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=166ce2a1-6596-6d39-47c5-52d791c8051a@suse.com \
    --to=jgross@suse.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.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).