xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Nate Studer <nate.studer@dornerworks.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Robert VanVossen <robert.vanvossen@dornerworks.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH 2/3] arinc: Add cpu-pool support to scheduler.
Date: Tue, 19 Nov 2013 18:16:35 +0000	[thread overview]
Message-ID: <528BAB03.4050706@citrix.com> (raw)
In-Reply-To: <528B6E99.8090707@dornerworks.com>

On 19/11/2013 13:58, Nate Studer wrote:
> On 11/19/2013 5:30 AM, Andrew Cooper wrote:
>
>>>  
>>> @@ -380,7 +369,9 @@ a653sched_deinit(const struct scheduler *ops)
>>>  static void *
>>>  a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
>>>  {
>>> +    a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
>>>      arinc653_vcpu_t *svc;
>>> +    int entry;
>> sched_priv->num_schedule_entries is inconsistently used as signed and
>> unsigned.  It should be an unsigned value, and updated to be so
>> everywhere, including in the a653sched_priv_t structure.
>>
> Right, this inconsistency should be fixed.
>
>>>  
>>>      /*
>>>       * Allocate memory for the ARINC 653-specific scheduler data information
>>> @@ -390,6 +381,19 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
>>>      if ( svc == NULL )
>>>          return NULL;
>>>  
>>> +    /* add every one of dom0's vcpus to the schedule */
>>> +    if (vc->domain->domain_id == 0)
>> Xen style would include spaces immediately inside the brackets.
>>
>> Also, it looks like you could do with a bounds check against
>> ARINC653_MAX_DOMAINS_PER_SCHEDULE before trying to put another dom0 into
>> the mix.
> Will add bounds checking.
>
>>>  /**
>>> @@ -538,8 +542,13 @@ a653sched_do_schedule(
>>>      static int sched_index = 0;
>>>      static s_time_t next_switch_time;
>>>      a653sched_priv_t *sched_priv = SCHED_PRIV(ops);
>>> +    const int cpu = smp_processor_id();
>> This should be an unsigned int.
> Yes it should.  This needs to be fixed in pick_cpu as well.
>
>>>  
>>> -    if ( now >= sched_priv->next_major_frame )
>>> +    if ( sched_priv->num_schedule_entries < 1 )
>>> +    {
>>> +        sched_priv->next_major_frame = now + DEFAULT_TIMESLICE;
>>> +    }
>> Xen style would require these braces to be omitted.
> Even when followed by a multiple statement "else if"?  I see braces in the same
> construct in the credit scheduler.
>
>     if ( list_empty(&svc->active_vcpu_elem) )
>     {
>         __csched_vcpu_acct_start(prv, svc);
>     }
>     else if ( _csched_cpu_pick(ops, current, 0) != cpu )
>     {
>
> I have no problem changing it, since I want to avoid spreading styling
> inconsistencies, but I just want to make sure.

Yes, even with multiple "else if" statements.  In this case, the credit
scheduler would be wrong. 

Style fixes like this are typically introduced on a 'when working in the
area' basis.  This avoids style fixes for the sake of style fixes, as
much as it prevents propagating bad style.

~Andrew

>
>>> +    else if ( now >= sched_priv->next_major_frame )
>>>      {
>>>          /* time to enter a new major frame
>>>           * the first time this function is called, this will be true */
> The remaining comments are style comments, which I will fix up in the next
> version of the patch.
>
>      Nate
>

  parent reply	other threads:[~2013-11-19 18:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 20:16 [PATCH 0/3] arinc: Implement cpu-pool support Nathan Studer
2013-11-18 20:16 ` [PATCH 1/3] arinc: whitespace and formatting fixes Nathan Studer
2013-11-19  9:54   ` Andrew Cooper
2013-11-19 11:30   ` George Dunlap
2013-11-18 20:16 ` [PATCH 2/3] arinc: Add cpu-pool support to scheduler Nathan Studer
2013-11-19 10:30   ` Andrew Cooper
2013-11-19 11:18     ` George Dunlap
2013-11-19 11:33       ` Andrew Cooper
2013-11-19 13:01         ` Nate Studer
2013-11-19 13:58     ` Nate Studer
2013-11-19 14:04       ` Nate Studer
2013-11-19 18:16       ` Andrew Cooper [this message]
2013-11-19 11:30   ` George Dunlap
2013-11-18 20:16 ` [PATCH 3/3] arinc: Add poolid parameter to scheduler get/set functions Nathan Studer
2013-11-19 10:32   ` Andrew Cooper
2013-11-19 11:32     ` George Dunlap

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=528BAB03.4050706@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=nate.studer@dornerworks.com \
    --cc=robert.vanvossen@dornerworks.com \
    --cc=xen-devel@lists.xen.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 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).