From: Dario Faggioli <dario.faggioli@citrix.com>
To: Meng Xu <mengxu@cis.upenn.edu>, Tianyang Chen <tiche@seas.upenn.edu>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
George Dunlap <george.dunlap@citrix.com>,
Dagaen Golomb <dgolomb@seas.upenn.edu>
Subject: Re: [PATCH v8]xen: sched: convert RTDS from time to event driven model
Date: Mon, 14 Mar 2016 12:58:07 +0100 [thread overview]
Message-ID: <1457956687.3102.657.camel@citrix.com> (raw)
In-Reply-To: <CAENZ-+mGPEXUBjteONHaMK++kABoFZ=qkyFZQHtqf3XKUcHd2g@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2246 bytes --]
On Fri, 2016-03-11 at 23:54 -0500, Meng Xu wrote:
>
> > @@ -1150,6 +1300,101 @@ rt_dom_cntl(
> > return rc;
> > }
> >
> > +/*
> > + * The replenishment timer handler picks vcpus
> > + * from the replq and does the actual replenishment.
> > + */
> > +static void repl_handler(void *data){
> > + unsigned long flags;
> > + s_time_t now = NOW();
> > + struct scheduler *ops = data;
> > + struct rt_private *prv = rt_priv(ops);
> > + struct list_head *replq = rt_replq(ops);
> > + struct list_head *runq = rt_runq(ops);
> > + struct timer *repl_timer = prv->repl_timer;
> > + struct list_head *iter, *tmp;
> > + struct list_head tmp_replq;
> > + struct rt_vcpu *svc = NULL;
> > +
> > + spin_lock_irqsave(&prv->lock, flags);
> Hmm, I haven't thought hard about the choice between
> spin_lock_irqsave() and spin_lock_irq(), before.
>
> Hi Dario,
> Is it better to use spin_lock_irqsave() or spin_lock_irq() at this
> place?
>
Just very quickly about this (I'll comment about the rest of the patch
later).
> I'm not quite sure if the handler can be called in an interrupt
> disabled context? Can it?
>
I recommend looking at what happens inside init_timer(), i.e., where a
pointer to this function is stashed. Then, still in xen/common/timer.c,
check where this (and, in general, a timer handling function provided
to timer_init()) is actually invoked.
When you'll find that spot, the answer to whether spin_lock_irq() is
safe or not in here, will appear quite evident. :-)
> When I used the spin_lock_irq(save), I just refered to what credit2
> scheduler does, but didn't think hard enough about which one has
> better performance.
>
I'm not sure what you mean when you talk about Credit2, as there are no
timers in there. In any case, it is indeed the case that, if just
_irq() is safe, we should use it, as it's cheaper.
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:[~2016-03-14 11:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 19:23 [PATCH v8]xen: sched: convert RTDS from time to event driven model Tianyang Chen
2016-03-12 4:54 ` Meng Xu
2016-03-12 22:21 ` Chen, Tianyang
2016-03-12 22:36 ` Andrew Cooper
2016-03-12 22:57 ` Chen, Tianyang
2016-03-13 15:43 ` Meng Xu
2016-03-14 11:48 ` Dario Faggioli
2016-03-14 13:54 ` Meng Xu
2016-03-14 11:58 ` Dario Faggioli [this message]
2016-03-14 15:38 ` Meng Xu
2016-03-14 16:03 ` Meng Xu
2016-03-14 16:35 ` Dario Faggioli
2016-03-14 17:40 ` Meng Xu
2016-03-14 16:24 ` Dario Faggioli
2016-03-14 17:37 ` 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=1457956687.3102.657.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=dgolomb@seas.upenn.edu \
--cc=george.dunlap@citrix.com \
--cc=mengxu@cis.upenn.edu \
--cc=tiche@seas.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 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.