lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Mar 2015 03:13:15 +0100
From:	Mike Galbraith <umgwanakikbuti@...il.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	linux-rt-users <linux-rt-users@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	John Kacur <jkacur@...hat.com>
Subject: Re: [rfc patch] rt,nohz_full: fix nohz_full for PREEMPT_RT_FULL

On Thu, 2015-03-12 at 11:09 -0400, Steven Rostedt wrote:
> On Thu, 12 Mar 2015 10:38:13 +0100
> Mike Galbraith <umgwanakikbuti@...il.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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ