From: Dario Faggioli <dario.faggioli@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Jan Beulich <JBeulich@suse.com>,
George Dunlap <george.dunlap@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Anshul Makkar <anshul.makkar@citrix.com>,
MengXu <mengxu@cis.upenn.edu>
Subject: Re: [PATCH 2/3] xen: Have schedulers revise initial placement
Date: Fri, 12 Aug 2016 01:35:21 +0200 [thread overview]
Message-ID: <1470958521.6250.37.camel@citrix.com> (raw)
In-Reply-To: <a52941cd-ac3d-40a1-b684-1938e6b31d81@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 3807 bytes --]
On Thu, 2016-08-11 at 16:51 +0100, Andrew Cooper wrote:
> On 11/08/16 15:59, Dario Faggioli wrote:
> >
> > Which, I think needs at least this hunk (from 6b53bb4ab3c9 "sched:
> > better handle (not) inserting idle vCPUs in runqueues"):
> >
> > diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> > index 2beebe8..fddcd52 100644
> > --- a/xen/common/schedule.c
> > +++ b/xen/common/schedule.c
> > @@ -240,20 +240,22 @@ int sched_init_vcpu(struct vcpu *v, unsigned
> > int processor)
> > init_timer(&v->poll_timer, poll_timer_fn,
> > v, v->processor);
> >
> > - /* Idle VCPUs are scheduled immediately. */
> > + v->sched_priv = SCHED_OP(DOM2OP(d), alloc_vdata, v, d-
> > >sched_priv);
> > + if ( v->sched_priv == NULL )
> > + return 1;
> > +
> > + TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
> > +
> > + /* Idle VCPUs are scheduled immediately, so don't put them in
> > runqueue. */
> > if ( is_idle_domain(d) )
> > {
> > per_cpu(schedule_data, v->processor).curr = v;
> > v->is_running = 1;
> > }
> > -
> > - TRACE_2D(TRC_SCHED_DOM_ADD, v->domain->domain_id, v->vcpu_id);
> > -
> > - v->sched_priv = SCHED_OP(DOM2OP(d), alloc_vdata, v, d-
> > >sched_priv);
> > - if ( v->sched_priv == NULL )
> > - return 1;
> > -
> > - SCHED_OP(DOM2OP(d), insert_vcpu, v);
> > + else
> > + {
> > + SCHED_OP(DOM2OP(d), insert_vcpu, v);
> > + }
> >
> > return 0;
> > }
> >
> > So, yeah, it's proving a little more complicated than how I thought
> > it
> > would have, just by looking at the patches. :-/
> >
> > Will let know.
> FWIW, this looks very similar to the regression I just raised against
> Xen 4.7 "[Xen-devel] Scheduler regression in 4.7". The stack traces
> are
> suspiciously similar.
>
I thought the same at the beginning, but they actually may not be the
same or even related.
This happens at early boot, and reason is we try to call
csched_cpu_pick() on the idle vcpus, which does not make any sense, and
in fact one of the ASSERTS triggers.
In your case, system has booted fine already. And the reason for that
is you're looking at 4.7, and 4.7 is no longer calling insert_vcpu(),
which then calls csched_cpu_pick(), on idle vcpus at boot, thanks to
the patch I'm mentioning above.
And in fact, I confirm that, on 4.6, with "just" the hunk above of said
patch, I can boot, create a (large) VM, play a bit with it, shutdown or
reboot it, and shutdown the host as well.
Also, yours seems to _explode_ because of a race on the runq (in
IS_RUNQ_IDLE()), this one _asserts_ here:
/* Pick an online CPU from the proper affinity mask */
csched_balance_cpumask(vc, balance_step, &cpus);
cpumask_and(&cpus, &cpus, online);
/* If present, prefer vc's current processor */
cpu = cpumask_test_cpu(vc->processor, &cpus)
? vc->processor
: cpumask_cycle(vc->processor, &cpus);
ASSERT(cpumask_test_cpu(cpu, &cpus));
Because, as I said, we're on early boot, and most likely, there's
almost no one in online!
> I expect they have the same root cause.
>
No, I think they're two different things.
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: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-08-11 23:35 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 18:02 [PATCH 1/3] xen: Some code motion to avoid having to do forward-declaration George Dunlap
2016-07-15 18:02 ` [PATCH 2/3] xen: Have schedulers revise initial placement George Dunlap
2016-07-15 18:07 ` Andrew Cooper
2016-07-16 14:12 ` Dario Faggioli
2016-07-18 18:10 ` Andrew Cooper
2016-07-18 18:55 ` Dario Faggioli
2016-07-18 21:36 ` Andrew Cooper
2016-07-19 7:14 ` Dario Faggioli
2016-07-18 10:28 ` Dario Faggioli
2016-07-25 11:17 ` George Dunlap
2016-07-25 14:36 ` Meng Xu
2016-07-26 9:17 ` Dario Faggioli
2016-07-25 14:35 ` Meng Xu
2016-08-01 10:40 ` Jan Beulich
2016-08-01 12:32 ` Dario Faggioli
2016-08-05 13:24 ` Jan Beulich
2016-08-05 14:09 ` Dario Faggioli
2016-08-05 14:44 ` Jan Beulich
2016-08-11 14:59 ` Dario Faggioli
2016-08-11 15:51 ` Andrew Cooper
2016-08-11 23:35 ` Dario Faggioli [this message]
2016-08-12 1:59 ` dependences for backporting to 4.6 [was: Re: [PATCH 2/3] xen: Have schedulers revise initial placement] Dario Faggioli
2016-08-12 13:53 ` Jan Beulich
2016-08-16 10:21 ` Dario Faggioli
2016-08-16 11:21 ` Jan Beulich
2016-08-12 8:58 ` dependences for backporting to 4.5 " Dario Faggioli
2016-07-15 18:02 ` [PATCH 3/3] xen: Remove buggy initial placement algorithm George Dunlap
2016-07-15 18:10 ` Andrew Cooper
2016-07-16 13:55 ` Dario Faggioli
2016-07-18 10:03 ` George Dunlap
2016-07-16 15:48 ` [PATCH 1/3] xen: Some code motion to avoid having to do forward-declaration Meng Xu
2016-07-18 9:58 ` Dario Faggioli
2016-07-18 10:06 ` 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=1470958521.6250.37.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=anshul.makkar@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=mengxu@cis.upenn.edu \
--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).