All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tianyang Chen <tianyangpenn@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: dario.faggioli@citrix.com, george.dunlap@citrix.com,
	Dagaen Golomb <dgolomb@seas.upenn.edu>,
	Meng Xu <mengxu@cis.upenn.edu>
Subject: Re: [PATCH v3 1/1] xen: sched: convert RTDS from time to event driven model
Date: Thu, 21 Jan 2016 23:31:25 -0500	[thread overview]
Message-ID: <56A1B09D.7030501@gmail.com> (raw)
In-Reply-To: <1453435594-4407-2-git-send-email-tiche@seas.upenn.edu>



On 1/21/2016 11:06 PM, Tianyang Chen wrote:
> Budget replenishment and enforcement are separated by adding
> a replenishment timer, which fires at the next most imminent
> release time of all runnable vcpus.
>
> A new runningq has been added to keep track of all vcpus that
> are on pcpus.
>
> The following functions have major changes to manage the runningq
> and replenishment
Well, I'm just gonna comment on couple things here. The major difference 
between
this patch and the previous one is the addition of a runningq, which 
leads to
extra code in context_save().

Since the scheduler doesn't run until the first vcpu wakes up, wake() 
does some of the
timer stuff, in additional to the logic in the handler. It works nicely 
especially when
a vcpu wakes up and has the earliest next release time.

> @@ -160,6 +169,7 @@ struct rt_private {
>    */
>   struct rt_vcpu {
>       struct list_head q_elem;    /* on the runq/depletedq list */
> +    struct list_head runningq_elem; /* on the runningq list */
>       struct list_head sdom_elem; /* on the domain VCPU list */
>   
Is it better to re-use q-elem so extra helper functions can be
avoided? Maybe another flag thing that shows which q a vcpu is on?
> @@ -848,8 +880,6 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
>       /* burn_budget would return for IDLE VCPU */
>       burn_budget(ops, scurr, now);
>   
> -    __repl_update(ops, now);
> -
>       if ( tasklet_work_scheduled )
>       {
>           snext = rt_vcpu(idle_vcpu[cpu]);
> @@ -875,6 +905,9 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
>           set_bit(__RTDS_delayed_runq_add, &scurr->flags);
>   
>       snext->last_start = now;
> +
> +    ret.time =  -1; /* if an idle vcpu is picked */
> +
I kinda just stick this in based on previous discussion on RTDS 
busy-waiting.

>
> +/* The replenishment timer handler scans
> + * all three queues and find the most
> + * imminent release time. If there is no
> + * vcpus, timer is set in wake()
> + */
> +static void repl_handler(void *data){
> +    unsigned long flags;
> +    s_time_t now = NOW();
> +    s_time_t min_repl = LONG_MAX; /* max time used in comparisoni */
> +    struct scheduler *ops = data;
> +    struct rt_private *prv = rt_priv(ops);
> +    struct list_head *runq = rt_runq(ops);
> +    struct list_head *depletedq = rt_depletedq(ops);
> +    struct list_head *runningq = rt_runningq(ops);
> +    struct list_head *iter;
> +    struct list_head *tmp;
> +    struct rt_vcpu *svc = NULL;
> +
> +    stop_timer(&repl_timer);
> +
> +    spin_lock_irqsave(&prv->lock, flags);
> +
Here is a lock for protecting queues. Correct me if I'm wrong, since in 
alloc_pdata(), the private lock points to
the global system lock, I just assume there is no difference here.

--
Tianyang Chen

  reply	other threads:[~2016-01-22  4:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22  4:06 [PATCH v3 0/1] xen: sched: convert RTDS from time to event driven model Tianyang Chen
2016-01-22  4:06 ` [PATCH v3 1/1] " Tianyang Chen
2016-01-22  4:31   ` Tianyang Chen [this message]
2016-01-22 13:34   ` Dario Faggioli
2016-01-22 14:41     ` 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=56A1B09D.7030501@gmail.com \
    --to=tianyangpenn@gmail.com \
    --cc=dario.faggioli@citrix.com \
    --cc=dgolomb@seas.upenn.edu \
    --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 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.