[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 1/4] xen: add real time scheduler rtds



>>> On 16.09.14 at 18:38, <xumengpanda@xxxxxxxxx> wrote:
> 2014-09-16 4:52 GMT-04:00 Jan Beulich <JBeulich@xxxxxxxx>:
>>
>> >>> On 16.09.14 at 10:42, <dario.faggioli@xxxxxxxxxx> wrote:
>> > On Sun, 2014-09-14 at 17:37 -0400, Meng Xu wrote:
>> >> --- /dev/null
>> >> +++ b/xen/common/sched_rt.c
>> >
>> >> +/*
>> >> + * Init/Free related code
>> >> + */
>> >> +static int
>> >> +rt_init(struct scheduler *ops)
>> >> +{
>> >> +    struct rt_private *prv = xzalloc(struct rt_private);
>> >> +
>> >> +    printk("Initializing RTDS scheduler\n" \
>> >> +           "WARNING: This is experimental software in development.\n" \
>> >> +           "Use at your own risk.\n");
>> >>
>> > I don't think you need the '\' in this case...
>>
>> Definitely not. Please drop.
>>
>> >> +    list_for_each_safe(iter, tmp, runq)
>> >> +    {
>> >> +        svc = __q_elem(iter);
>> >> +
>> >> +        if ( now >= svc->cur_deadline )
>> >> +        {
>> >> +            rt_update_deadline(now, svc);
>> >> +            /* reinsert the vcpu if its deadline is updated */
>> >> +            __q_remove(svc);
>> >> +            __runq_insert(ops, svc);
>> >> +        }
>> >> +        else
>> >> +            break;
>> >>
>> > Just from an aesthetic perspective, I think I'd have inverted the
>> > condition and, hence, the two brances (i.e., "if ( < ) break; else {}").
>>
>> In which case the "else" and with it one level of indentation
>> should go away.
> 
> 
> So the code will be like this:
> 
> if ( < )
>     break;
> 
> rt_update_deadline(now, svc);
>  /* reinsert the vcpu if its deadline is updated */
>  __q_remove(svc);
> __runq_insert(ops, svc);
> 
> 
> Am I correct? (Just confirm I understand what you said correctly. :-) )

Yes.

Jan


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.