xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
	Chong Li <lichong659@gmail.com>
Cc: Chong Li <chong.li@wustl.edu>, Sisu Xi <xisisu@gmail.com>,
	george.dunlap@eu.citrix.com, xen-devel@lists.xen.org,
	Meng Xu <mengxu@cis.upenn.edu>,
	dgolomb@seas.upenn.edu
Subject: Re: [PATCH v7 for Xen 4.7 1/4] xen: enable per-VCPU parameter settings for RTDS scheduler
Date: Fri, 18 Mar 2016 01:48:17 -0600	[thread overview]
Message-ID: <56EBC0D102000078000DE338@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1458209010.15374.20.camel@citrix.com>

>>> On 17.03.16 at 11:03, <dario.faggioli@citrix.com> wrote:
> On Wed, 2016-03-16 at 11:47 -0500, Chong Li wrote:
>> --- a/xen/common/sched_credit.c
>> +++ b/xen/common/sched_credit.c
>> @@ -1054,15 +1054,16 @@ csched_dom_cntl(
>>       * lock. Runq lock not needed anywhere in here. */
>>      spin_lock_irqsave(&prv->lock, flags);
>>  
>> -    if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
>> +    switch ( op->cmd )
>>      {
>> +    case XEN_DOMCTL_SCHEDOP_putvcpuinfo:
>> +    case XEN_DOMCTL_SCHEDOP_getvcpuinfo:
>> +        return -EINVAL;
>> +    case XEN_DOMCTL_SCHEDOP_getinfo:
>>          op->u.credit.weight = sdom->weight;
>>          op->u.credit.cap = sdom->cap;
>>
> Not feeling to strong about it, but I think
> 
>     switch ( op->cmd )
>     {
>     case XEN_DOMCTL_SCHEDOP_getinfo:
>         op->u.credit.weight = sdom->weight;
>         op->u.credit.cap = sdom->cap;
>         break;
>     case XEN_DOMCTL_SCHEDOP_putinfo:
>         if ( op->u.credit.weight != 0 )
>         {
>             if ( !list_empty(&sdom->active_sdom_elem) )
>             {
>                 prv->weight -= sdom->weight * sdom->active_vcpu_count;
>                 prv->weight += op->u.credit.weight * sdom->active_vcpu_count;
>             }
>             sdom->weight = op->u.credit.weight;
>         }
> 
>         if ( op->u.credit.cap != (uint16_t)~0U )
>             sdom->cap = op->u.credit.cap;
>         break;
>     case XEN_DOMCTL_SCHEDOP_putvcpuinfo:
>     case XEN_DOMCTL_SCHEDOP_getvcpuinfo:
>     default:
>         return -EINVAL;
>     }
> 
> (i.e., grouping the cases that needs only returning -EINVAL) is better,
> the final result, more than the patch itself.

In fact there's no point in explicitly naming the unhandled values
as long as they're matching what "default:" does.

Jan


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

  parent reply	other threads:[~2016-03-18  7:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 16:47 [PATCH v7 for Xen 4.7 0/4] Enable per-VCPU parameter settings for RTDS scheduler Chong Li
2016-03-16 16:47 ` [PATCH v7 for Xen 4.7 1/4] xen: enable " Chong Li
2016-03-17 10:03   ` Dario Faggioli
2016-03-17 20:42     ` Chong Li
2016-03-18  7:39       ` Jan Beulich
2016-03-18 10:47         ` Dario Faggioli
2016-03-18 20:22           ` Chong Li
2016-03-18  7:48     ` Jan Beulich [this message]
2016-03-16 16:47 ` [PATCH v7 for Xen 4.7 2/4] libxc: " Chong Li
2016-03-16 19:24   ` Wei Liu
2016-03-17  2:28   ` Dario Faggioli
2016-03-16 16:47 ` [PATCH v7 for Xen 4.7 3/4] libxl: " Chong Li
2016-03-16 19:24   ` Wei Liu
2016-03-17  4:05   ` Dario Faggioli
2016-03-17 19:50     ` Chong Li
2016-03-18  9:17       ` Dario Faggioli
2016-03-17  4:29   ` Dario Faggioli
2016-03-16 16:47 ` [PATCH v7 for Xen 4.7 4/4] xl: " Chong Li
2016-03-16 19:24   ` Wei Liu
2016-03-16 19:29     ` 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=56EBC0D102000078000DE338@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=chong.li@wustl.edu \
    --cc=dario.faggioli@citrix.com \
    --cc=dgolomb@seas.upenn.edu \
    --cc=george.dunlap@eu.citrix.com \
    --cc=lichong659@gmail.com \
    --cc=mengxu@cis.upenn.edu \
    --cc=xen-devel@lists.xen.org \
    --cc=xisisu@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).