From: George Dunlap <george.dunlap@eu.citrix.com>
To: Meng Xu <mengxu@cis.upenn.edu>, xen-devel@lists.xen.org
Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com,
dario.faggioli@citrix.com, ian.jackson@eu.citrix.com,
xumengpanda@gmail.com, JBeulich@suse.com
Subject: Re: [PATCH for Xen 4.5 v2 2/2] xen: serialize vcpu data in sched_rt.c
Date: Mon, 10 Nov 2014 12:53:36 +0000 [thread overview]
Message-ID: <5460B550.9000306@eu.citrix.com> (raw)
In-Reply-To: <1414246599-3914-3-git-send-email-mengxu@cis.upenn.edu>
On 10/25/2014 03:16 PM, Meng Xu wrote:
> Move call to rt_update_deadline from _alloc to _insert;
> Add lock in rt_vcpu_remove().
>
> Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
This describes what the patch does, but not why.
While it's nice to have a summary of the technical changes the patch
makes, that's information I can get from the patch itself. What's
critical is an explanation of *why* you are moving rt_update_deadline
from _alloc to _insert.
Having the information in the cover letter isn't enough, because that
probably won't be available to someone going through the git history and
trying to figure out why you made this change.
-George
> ---
> xen/common/sched_rt.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
> index b87c95b..f136724 100644
> --- a/xen/common/sched_rt.c
> +++ b/xen/common/sched_rt.c
> @@ -508,7 +508,6 @@ static void *
> rt_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
> {
> struct rt_vcpu *svc;
> - s_time_t now = NOW();
>
> /* Allocate per-VCPU info */
> svc = xzalloc(struct rt_vcpu);
> @@ -526,10 +525,6 @@ rt_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
> if ( !is_idle_vcpu(vc) )
> svc->budget = RTDS_DEFAULT_BUDGET;
>
> - ASSERT( now >= svc->cur_deadline );
> -
> - rt_update_deadline(now, svc);
> -
> return svc;
> }
>
> @@ -552,11 +547,15 @@ static void
> rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
> {
> struct rt_vcpu *svc = rt_vcpu(vc);
> + s_time_t now = NOW();
>
> /* not addlocate idle vcpu to dom vcpu list */
> if ( is_idle_vcpu(vc) )
> return;
>
> + if ( now >= svc->cur_deadline )
> + rt_update_deadline(now, svc);
> +
> if ( !__vcpu_on_q(svc) && vcpu_runnable(vc) && !vc->is_running )
> __runq_insert(ops, svc);
>
> @@ -573,11 +572,14 @@ rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
> {
> struct rt_vcpu * const svc = rt_vcpu(vc);
> struct rt_dom * const sdom = svc->sdom;
> + spinlock_t *lock;
>
> BUG_ON( sdom == NULL );
>
> + lock = vcpu_schedule_lock_irq(vc);
> if ( __vcpu_on_q(svc) )
> __q_remove(svc);
> + vcpu_schedule_unlock_irq(lock, vc);
>
> if ( !is_idle_vcpu(vc) )
> list_del_init(&svc->sdom_elem);
next prev parent reply other threads:[~2014-11-10 12:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-25 14:16 Sanity check input and serialize vcpu data in sched_rt.c Meng Xu
2014-10-25 14:16 ` [PATCH for Xen 4.5 v2 1/2] xen: sanity check input and serialization " Meng Xu
2014-10-29 9:41 ` Dario Faggioli
2014-10-29 14:27 ` Meng Xu
2014-11-10 12:54 ` George Dunlap
2014-10-25 14:16 ` [PATCH for Xen 4.5 v2 2/2] xen: serialize vcpu data " Meng Xu
2014-10-29 9:26 ` Dario Faggioli
2014-11-10 12:53 ` George Dunlap [this message]
2014-11-10 15:29 ` Meng Xu
2014-11-10 15:36 ` Dario Faggioli
2014-11-10 15:38 ` George Dunlap
2014-11-10 15:40 ` George Dunlap
2014-11-10 16:04 ` Meng Xu
2014-11-10 16:15 ` George Dunlap
2014-10-29 10:06 ` Sanity check input and " Dario Faggioli
2014-10-29 14:23 ` Meng Xu
2014-10-29 17:52 ` Konrad Rzeszutek Wilk
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=5460B550.9000306@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=dario.faggioli@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=mengxu@cis.upenn.edu \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.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 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.