From: Dario Faggioli <dario.faggioli@citrix.com>
To: Meng Xu <xumengpanda@gmail.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
Sisu Xi <xisisu@gmail.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
George Dunlap <george.dunlap@eu.citrix.com>,
Chenyang Lu <lu@cse.wustl.edu>,
Ian Jackson <ian.jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Linh Thi Xuan Phan <ptxlinh@gmail.com>,
Meng Xu <mengxu@cis.upenn.edu>, Jan Beulich <JBeulich@suse.com>,
Chao Wang <chaowang@wustl.edu>, Chong Li <lichong659@gmail.com>,
Dagaen Golomb <dgolomb@seas.upenn.edu>
Subject: Re: [PATCH v2 1/4] xen: add real time scheduler rt
Date: Thu, 11 Sep 2014 10:44:37 +0200 [thread overview]
Message-ID: <1410425077.3656.8.camel@Abyss> (raw)
In-Reply-To: <CAENZ-+k1B30F=8GDfOf3zPKXNcjwzVeLO9tN_SEs5nkRrRHbBg@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3813 bytes --]
On Tue, 2014-09-09 at 14:21 -0400, Meng Xu wrote:
> >> +/*
> >> + * Debug related code, dump vcpu/cpu information
> >> + */
> >> +static void
> >> +rt_dump_vcpu(const struct scheduler *ops, const struct rt_vcpu *svc)
> >> +{
> >> + struct rt_private *prv = RT_PRIV(ops);
> >> + char cpustr[1024];
> >> + cpumask_t *cpupool_mask;
> >> +
> >> + ASSERT(svc != NULL);
> >> + /* flag vcpu */
> >> + if( svc->sdom == NULL )
> >> + return;
> >> +
> >> + cpumask_scnprintf(cpustr, sizeof(cpustr), svc->vcpu->cpu_hard_affinity);
> >> + printk("[%5d.%-2u] cpu %u, (%"PRI_stime", %"PRI_stime"),"
> >> + " cur_b=%"PRI_stime" cur_d=%"PRI_stime" last_start=%"PRI_stime
> >> + " onR=%d runnable=%d cpu_hard_affinity=%s ",
> >>
> > How does this come up in the console? Should we break it with a '\n'
> > somewhere? It looks rather long...
>
> Some information is not so useful here, such as the period and budget
> of the vcpu, which can be displayed by using the tool stack. I can
> remove some of them to make this line shorter. I will remove
> svc->budget, svc->period and prv->cpus.
>
Well, as you wish... A '\n' (and perhaps some more formatting with
'\t'-s, etch) would be fine too, IMO.
> >> + schedule_lock = per_cpu(schedule_data, svc->vcpu->processor).schedule_lock;
> >> + ASSERT( spin_is_locked(schedule_lock) );
> >> +
> > As of now, the only lock around is prv->lock, isn't it? So this
> > per_cpu(xxx) is a complex way to get to prv->lock, or am I missing
> > something.
>
> Yes. It's the only lock right now. When I split the RunQ to two
> queues: RunQ, DepletedQ, I can still use one lock, (but probably two
> locks are more efficient?)
>
> >
> > In credit, the pre-inited set of locks are actually used "as they are",
> > while in credit2, there is some remapping going on, but there is more
> > than one lock anyway. That's why you find things like the above in those
> > two schedulers. Here, you should not need anything like that, (as you do
> > everywhere else) just go ahead and use prv->lock.
> >
> > Of course, that does not mean you don't need the lock remapping in
> > rt_alloc_pdata(). That code looks ok to me, just adapt this bit above,
> > as, like this, it makes things harder to understand.
> >
> > Or am I overlooking something?
>
> I think you didn't overlook anything. I will refer to credit2 to see
> how it is using multiple locks, since it's likely we will have two
> locks here.
>
I don't think you do. I mentioned credit2 only to make it clear why
notation like the one above is required there, and to highlight that it
is _not_ required in your case.
Even if you start using 2 queues, one for runnable and one for depleted
vcpus, access to both can well be serialized by the same lock. In fact,
in quite a few places, you'd need moving vcpus from one queue to the
other, i.e., you'd be forced to take both of the locks anyway.
I do think that using separate queues may improve scalability, and
adopting a different locking strategy could make that happen, but I just
won't do that right now, at this point of the release cycle. For now,
the two queue approach will "just" make the code easier to read,
understand and hack, which is already something really important,
especially for an experimental feature.
So, IMO, just replace the line above with a simple "&prv->lock" and get
done with it, without adding any more locks, or changing the locking
logic.
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
next prev parent reply other threads:[~2014-09-11 8:44 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-07 19:40 Introduce rt real-time scheduler for Xen Meng Xu
2014-09-07 19:40 ` [PATCH v2 1/4] xen: add real time scheduler rt Meng Xu
2014-09-08 14:32 ` George Dunlap
2014-09-08 18:44 ` George Dunlap
2014-09-09 9:42 ` Dario Faggioli
2014-09-09 11:31 ` George Dunlap
2014-09-09 12:52 ` Meng Xu
2014-09-09 12:25 ` Meng Xu
2014-09-09 12:46 ` Meng Xu
2014-09-09 16:57 ` Dario Faggioli
2014-09-09 18:21 ` Meng Xu
2014-09-11 8:44 ` Dario Faggioli [this message]
2014-09-11 13:49 ` Meng Xu
2014-09-07 19:40 ` [PATCH v2 2/4] libxc: add rt scheduler Meng Xu
2014-09-08 14:38 ` George Dunlap
2014-09-08 14:50 ` Ian Campbell
2014-09-08 14:53 ` Dario Faggioli
2014-09-07 19:41 ` [PATCH v2 3/4] libxl: " Meng Xu
2014-09-08 15:19 ` George Dunlap
2014-09-09 12:59 ` Meng Xu
2014-09-07 19:41 ` [PATCH v2 4/4] xl: introduce " Meng Xu
2014-09-08 16:06 ` George Dunlap
2014-09-08 16:16 ` Dario Faggioli
2014-09-09 13:14 ` Meng Xu
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=1410425077.3656.8.camel@Abyss \
--to=dario.faggioli@citrix.com \
--cc=JBeulich@suse.com \
--cc=chaowang@wustl.edu \
--cc=dgolomb@seas.upenn.edu \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=lichong659@gmail.com \
--cc=lu@cse.wustl.edu \
--cc=mengxu@cis.upenn.edu \
--cc=ptxlinh@gmail.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=xisisu@gmail.com \
--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 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).