linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Anna-Maria Gleixner <anna-maria@linutronix.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH] nohz: Fix missing tick reprog while interrupting inline timer softirq
Date: Fri, 24 Aug 2018 16:27:15 +0200	[thread overview]
Message-ID: <20180824142713.GB2730@lerouge> (raw)
In-Reply-To: <alpine.DEB.2.21.1808240851420.1668@nanos.tec.linutronix.de>

On Fri, Aug 24, 2018 at 09:01:02AM +0200, Thomas Gleixner wrote:
> On Fri, 24 Aug 2018, Greg KH wrote:
> > On Thu, Aug 23, 2018 at 05:57:06PM -0500, Grygorii Strashko wrote:
> > > This patch was back ported to the Stable linux-4.14.y and It causes regression -
> > >  flood of "NOHZ: local_softirq_pending" messages on all TI boards during boot (NFS boot):
> > > 
> > > [    4.179796] NOHZ: local_softirq_pending 2c2 in sirq 256
> > > [    4.185051] NOHZ: local_softirq_pending 2c2 in sirq 256
> 
> This printout is weird. Did you add something here?
> 
> > > the same is not reproducible with LKML - seems due to changes in tick-sched.c 
> > > __tick_nohz_idle_enter()/tick_nohz_irq_exit().
> > 
> > What changes do you think fixed this?
> > 
> > > I've generated backtrace from  can_stop_idle_tick() (see below) and seems this
> > > patch makes tick_nohz_irq_exit() call unconditional in case of nested interrupt:
> > > 
> > > gic_handle_irq
> > >  |- irq_exit
> > >     |- preempt_count_sub(HARDIRQ_OFFSET); <-- [1]
> > >     |-__do_softirq 
> > > 	<irqs enabled>
> > > 	|- gic_handle_irq()
> > > 	   |- irq_exit()
> > > 		|- tick_irq_exit()
> > > 		   if (!in_irq()) <-- My understanding is that this condition will be always true due to [1]
> 
> Correct, but that's not the problem. The issue is that this happens in a
> softirq disabled region. Does the below fix it?
> 
> Thanks,
> 
> 	tglx
> 
> 8<--------------------
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index 5b33e2f5c0ed..6aab9d54a331 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -888,7 +888,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
>  	if (unlikely(local_softirq_pending() && cpu_online(cpu))) {
>  		static int ratelimit;
>  
> -		if (ratelimit < 10 &&
> +		if (ratelimit < 10 && !in_softirq() &&
>  		    (local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) {
>  			pr_warn("NOHZ: local_softirq_pending %02x\n",
>  				(unsigned int) local_softirq_pending());
> 
> 

Good catch! In 4.14 Rafael hadn't yet changed the path where we stop the idle tick.
We were still stopping it from irq exit and so we could do that while interrupting a
softirq. So we may need to backport this along with "nohz: Fix missing tick reprogram
when interrupting an inline softirq".

  reply	other threads:[~2018-08-24 14:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 22:52 [PATCH] nohz: Fix missing tick reprog while interrupting inline timer softirq Frederic Weisbecker
2018-08-01 12:03 ` Anna-Maria Gleixner
2018-08-01 17:46 ` Thomas Gleixner
2018-08-01 21:08   ` Frederic Weisbecker
2018-08-03 11:42     ` Thomas Gleixner
2018-08-23 22:57 ` Grygorii Strashko
2018-08-24  6:17   ` Greg KH
2018-08-24  7:01     ` Thomas Gleixner
2018-08-24 14:27       ` Frederic Weisbecker [this message]
2018-08-24 16:10       ` Grygorii Strashko
2018-08-24 18:41         ` Frederic Weisbecker
2018-08-28 17:56           ` Grygorii Strashko
2018-08-30 14:10             ` John Crispin
2018-08-30 14:29               ` Thomas Gleixner
2018-08-24 16:14     ` Grygorii Strashko

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=20180824142713.GB2730@lerouge \
    --to=frederic@kernel.org \
    --cc=anna-maria@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=grygorii.strashko@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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).