Hi Ingo,
On Tue, Mar 17, 2015 at 09:06:13AM +0100, Ingo Molnar wrote:
>
>* Wanpeng Li <[email protected]> wrote:
>
>> Hi Ingo,
>> On Mon, Mar 16, 2015 at 04:01:02PM +0100, Ingo Molnar wrote:
>> >> +
>> >> +                 /*
>> >> +                  * If cannot preempt any rq, fallback to pick any
>> >> +                  * online cpu.
>> >
>> >s/If cannot/If we cannot
>> >s/fallback/fall back
>> 
>> Will do.
>> 
>> >
>> >> +                  */
>> >> +                 fallback = true;
>> >> +                 cpu = cpumask_any_and(cpu_active_mask,
>> >> +                                         tsk_cpus_allowed(p));
>> >
>> >shouldn't be on separate lines - but this is also a sign that the guts 
>> 
>> Otherwise there is a "WARNING: line over 80 characters".
>
>Yes, but did your reaction to that tool's warning improve the code? I 
>don't think so. If do what I suggested and reduce indentation a bit, 
>you'll fix the warning _and_ improve the code. Win-win.

Cool, will do.

>
>> > of this new code should be in a helper function, not inside 
>> > several layers of branches.
>> 
>> Do you mean the whole patch should be in a helper function?
>
>Probably.

Will do.

>
>> >> +                 if (cpu >= nr_cpu_ids) {
>> >> +                         if (dl_bandwidth_enabled()) {
>> >> +                                 /*
>> >> +                                  * Fail to find any suitable cpu.
>> >> +                                  * The task will never come back!
>> >> +                                  */
>> >> +                                 WARN_ON(1);
>> >
>> > Can this condition happen to users with a non-buggy kernel?
>> 
>> What do you prefer? ;-)
>
>That was a yes/no question: can this condition trigger on correctly 
>working kernels?

How about add unlikely() here? 

Regards,
Wanpeng Li 

>
>Thanks,
>
>       Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to