xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Meng Xu <mengxu@cis.upenn.edu>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>,
	Dagaen Golomb <dgolomb@cis.upenn.edu>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Haoran Li <lihaoran@wustl.edu>,
	Dario Faggioli <dario.faggioli@citrix.com>,
	Linh Thi Xuan Phan <linhphan@cis.upenn.edu>,
	Meng Xu <xumengpanda@gmail.com>, Meng Xu <mengxu@cis.upenn.edu>,
	Tianyang Chen <tiche@cis.upenn.edu>
Subject: [PATCH] xen:rtds:Clear __RTDS_depleted bit once replenish vcpu
Date: Fri, 21 Oct 2016 22:12:02 -0400	[thread overview]
Message-ID: <1477102322-4162-1-git-send-email-mengxu@cis.upenn.edu> (raw)

We should clear the __RTDS_depleted bit once a VCPU budget is replenished.
Because repl_timer_handler may be called after rt_schedule
but before rt_context_saved, the VCPU may be not on CPU or on queue
when the VCPU is the middle of context switch

Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
---
Cc: Dario Faggioli <dario.faggioli@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Linh Thi Xuan Phan <linhphan@cis.upenn.edu>
Cc: Haoran Li <lihaoran@wustl.edu>
Cc: Meng Xu <xumengpanda@gmail.com>
Cc: Dagaen Golomb <dgolomb@cis.upenn.edu>
Cc: Tianyang Chen <tiche@cis.upenn.edu>
---
 xen/common/sched_rt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
index ff17bd2..16b5691 100644
--- a/xen/common/sched_rt.c
+++ b/xen/common/sched_rt.c
@@ -1488,8 +1488,8 @@ static void repl_timer_handler(void *data){
             if ( svc->cur_deadline > next_on_runq->cur_deadline )
                 runq_tickle(ops, next_on_runq);
         }
-        else if ( vcpu_on_q(svc) &&
-                  __test_and_clear_bit(__RTDS_depleted, &svc->flags) )
+        else if ( __test_and_clear_bit(__RTDS_depleted, &svc->flags) &&
+                  vcpu_on_q(svc) )
             runq_tickle(ops, svc);
 
         list_del(&svc->replq_elem);
-- 
1.9.1


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

             reply	other threads:[~2016-10-22  2:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-22  2:12 Meng Xu [this message]
2016-10-25  9:20 ` [PATCH] xen:rtds:Clear __RTDS_depleted bit once replenish vcpu Dario Faggioli
2016-10-25 13:27   ` Meng Xu
2016-10-26 12:41   ` Wei Liu

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=1477102322-4162-1-git-send-email-mengxu@cis.upenn.edu \
    --to=mengxu@cis.upenn.edu \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=dgolomb@cis.upenn.edu \
    --cc=lihaoran@wustl.edu \
    --cc=linhphan@cis.upenn.edu \
    --cc=tiche@cis.upenn.edu \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    --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).