On Thu, 2015-03-12 at 11:09 -0400, Steven Rostedt wrote:
> On Thu, 12 Mar 2015 10:38:13 +0100
> Mike Galbraith <umgwanakikb...@gmail.com> wrote:
> 

> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -783,12 +783,16 @@ static inline bool got_nohz_idle_kick(vo
> >  #ifdef CONFIG_NO_HZ_FULL
> >  bool sched_can_stop_tick(void)
> >  {
> > +   int softirqd = IS_ENABLED(CONFIG_PREEMPT_RT_FULL);
> > +
> > +   softirqd &= current == this_cpu_ksoftirqd();
> 
> Ug, binary and logical ANDs should not be combined. Just looks nasty.
> What about:
> 
>       softirqd = !!(IS_ENABLED(CONFIG_PREEMPT_RT_FULL) &&
>                       current == this_cpu_ksoftirqd());

My way looks prettier to me, but I seem to be the only who thinks so
(this is not the first time it got a gripe), so I'll change it ;-)

> > +
> >     /*
> >      * More than one running task need preemption.
> >      * nr_running update is assumed to be visible
> >      * after IPI is sent from wakers.
> >      */
> > -   if (this_rq()->nr_running > 1)
> > +   if (this_rq()->nr_running - softirqd > 1)
> 
> There should also be a comment explaining this hack.

Yeah.
  
> > --- a/kernel/time/tick-sched.c
> > +++ b/kernel/time/tick-sched.c
> > @@ -222,7 +222,14 @@ void __tick_nohz_full_check(void)
> >  
> >  static void nohz_full_kick_work_func(struct irq_work *work)
> >  {
> > +   unsigned long flags;
> > +
> > +   local_save_flags(flags);
> > +   /* ksoftirqd processes softirqs with interrupts enabled */
> > +   if (current == this_cpu_ksoftirqd())
> > +           local_irq_disable();
> 
> Why the funkiness above? Why not just call local_irq_save()?

Gone.  It would be good to make the rest gone too, it's ain't pretty it
just works.

        -Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
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