mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Greg KH <gregkh@linuxfoundation.org>
Cc: Frederic Weisbecker <frederic@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Anna-Maria Gleixner <anna-maria@linutronix.de>,
	<stable@vger.kernel.org>, Tero Kristo <t-kristo@ti.com>
Subject: Re: [PATCH] nohz: Fix missing tick reprog while interrupting inline timer softirq
Date: Fri, 24 Aug 2018 11:10:44 -0500	[thread overview]
Message-ID: <0d63c2bb-f75d-3f79-c19d-bb4ac9a00cd5@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1808240851420.1668@nanos.tec.linutronix.de>



On 08/24/2018 02:01 AM, 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?

yes. 

ff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index da74d2f..a5fad1c 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -910,8 +910,9 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
 
                if (ratelimit < 100 &&
                    (local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) {
-                       pr_warn("NOHZ: local_softirq_pending %02x in sirq %d\n",
+                       pr_warn("NOHZ: local_softirq_pending %02x in sirq %lu\n",
                                (unsigned int) local_softirq_pending(), in_softirq());
+                       WARN_ON_ONCE(true);
                        ratelimit++;
                }


> 
>>> 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());
> 
> 

Yes. i do not see local_softirq_pending messages any more

But one question, just to clarify, after patch "nohz: Fix missing tick reprog while interrupting inline timer softirq"
the tick_nohz_irq_exit() will be called few times in case of nested interrupts (min 2):
gic_handle_irq
 |- irq_exit
    |- preempt_count_sub(HARDIRQ_OFFSET); 
    |-__do_softirq 
	<irqs enabled>
	|- gic_handle_irq()
	   |- irq_exit()
		|- tick_irq_exit()
		   if (!in_irq())
			tick_nohz_irq_exit(); <-- [1]
    |- tick_irq_exit()
	if (!in_irq())
		tick_nohz_irq_exit(); <-- [2]

Is it correct? in 4.14 tick_nohz_irq_exit() is much more complex then in LKML now,
and this is hot path.


-- 
regards,
-grygorii

  parent reply	other threads:[~2018-08-24 16:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 22:52 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
2018-08-24 16:10       ` Grygorii Strashko [this message]
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=0d63c2bb-f75d-3f79-c19d-bb4ac9a00cd5@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=t-kristo@ti.com \
    --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

all inboxes | Powered by JetHome®