linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: paulmck@linux.vnet.ibm.com
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Paul McKenney <paul.mckenney@linaro.org>,
	LKML <linux-kernel@vger.kernel.org>,
	x86@kernel.org, linux-next <linux-next@vger.kernel.org>
Subject: Re: [next-20120823] NOHZ: local_softirq_pending 200 on s/r
Date: Thu, 23 Aug 2012 18:06:23 +0200	[thread overview]
Message-ID: <CA+icZUXq9p4yOuse5dzCb2FGmgSKdU8ufDkDcTjWJ0dE79tvUg@mail.gmail.com> (raw)
In-Reply-To: <20120823154346.GB2465@linux.vnet.ibm.com>

On Thu, Aug 23, 2012 at 5:43 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
> On Thu, Aug 23, 2012 at 12:46:37PM +0200, Thomas Gleixner wrote:
>> On Thu, 23 Aug 2012, Sedat Dilek wrote:
>>
>> > Hi,
>> >
>> > this week I was seeing the below NOHZ messages in my logs especially
>> > when suspending and resuming.
>> >
>> > Currently, I am using linux-next (next-20120823) on Ubuntu/precise
>> > AMD64 with a Intel S(a)N(dy)B(ridge)-CPU.
>> >
>> > $ dmesg | grep -A1 -B1 -i nohz
>> > [  720.331819] Disabling non-boot CPUs ...
>> > [  720.332035] NOHZ: local_softirq_pending 200
>> > [  720.434312] smpboot: CPU 1 is now offline
>> > [  720.434825] NOHZ: local_softirq_pending 200
>> > [  720.538237] smpboot: CPU 2 is now offline
>> > [  720.538676] NOHZ: local_softirq_pending 200
>> > [  720.642162] smpboot: CPU 3 is now offline
>> >
>> > If I manually disable the cpuX... First I did not see NOHZ messages
>> > but then there were some lines seen especially when cpuX went offline
>> > (here: cpu1)
>> >
>> > # echo 0 >/sys/devices/system/cpu/cpu1/online
>> >
>> > [ dmeg ]
>> > [ 2605.515771] smpboot: CPU 1 is now offline
>> >
>> > The same with cpu2 and cpu3.
>
> Hmmm...  RCU is actually relying on being able to prevent entry into idle
> by raising softirq.  This is needed for the aggressive energy-efficiency
> CONFIG_RCU_FAST_NO_HZ feature of RCU.  Therefore, I propose the patch
> shown below.
>
> Sedat, does this patch help?
>
>                                                         Thanx, Paul
>
>> > Jack Winter confirmed to see similiar NOHZ messages also on
>> > v3.4.9-rt17 kernel (CPU: Core2Duo when no suspend performed):
>> >
>> > [15223.171585] NOHZ: local_softirq_pending 08
>>
>> That's a different issue. That's a pending networking softirq when we
>> go idle. Unrelated to the RCU / hotplug issue you are observing.
>>
>> > So, the issue is seen on linux-next and -rt kernels.
>> >
>> > According to Thomas "softirq 0x200 is the RCU one" and he requested me
>> > to address the issue to Paul on #linux-rt.
>> >
>> > Regards,
>> > - Sedat -
>
> time: RCU permitted to stop idle entry via softirq
>
> RCU needs to be able to use softirq to stop idle entry in order to
> be able to drain RCU callbacks from the current CPU, which in turn
> enables faster entry into dyntick-idle mode, which in turn reduces power
> consumption.  This commit therefore silences the error message that is
> sometimes produced when the going-idle CPU suddenly finds that it has
> an RCU_SOFTIRQ to process.
>
> Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
>
> diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> index c5f856a..c0359d2 100644
> --- a/include/linux/interrupt.h
> +++ b/include/linux/interrupt.h
> @@ -430,6 +430,8 @@ enum
>         NR_SOFTIRQS
>  };
>
> +const int softirq_stop_idle_mask = (~(1 << RCU_SOFTIRQ));
> +
>  /* map softirq index to softirq name. update 'softirq_to_name' in
>   * kernel/softirq.c when adding a new softirq.
>   */
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index 024540f..84932cf 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -436,7 +436,8 @@ 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 &&
> +                   (local_softirq_pending() & softirq_stop_idle_mask)) {
>                         printk(KERN_ERR "NOHZ: local_softirq_pending %02x\n",
>                                (unsigned int) local_softirq_pending());
>                         ratelimit++;
>

Applying this patch on top of my local GIT tree results in error-messages:

[...]
  CC      kernel/rcupdate.o
  AS      arch/x86/platform/efi/efi_stub_64.o
  CC      arch/x86/kernel/irqinit.o
  LD      arch/x86/platform/efi/built-in.o
arch/x86/platform/efi/efi_64.o:(.rodata+0x0): multiple definition of
`softirq_stop_idle_mask'
arch/x86/platform/efi/efi.o:(.rodata+0x50): first defined here
make[5]: *** [arch/x86/platform/efi/built-in.o] Error 1
make[4]: *** [arch/x86/platform/efi] Error 2
make[3]: *** [arch/x86/platform] Error 2
make[3]: *** Waiting for unfinished jobs....
[...]

$ LC_ALL=C grep softirq_stop_idle_mask -nr linux-next/arch/x86/platform/efi/
Binary file linux-next/arch/x86/platform/efi/efi.o matches
Binary file linux-next/arch/x86/platform/efi/efi_64.o matches

- Sedat -

  reply	other threads:[~2012-08-23 16:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23 10:04 [next-20120823] NOHZ: local_softirq_pending 200 on s/r Sedat Dilek
2012-08-23 10:46 ` Thomas Gleixner
2012-08-23 15:43   ` Paul E. McKenney
2012-08-23 16:06     ` Sedat Dilek [this message]
2012-08-23 17:14       ` Paul E. McKenney
2012-08-23 18:55         ` Sedat Dilek
2012-08-23 19:09           ` Paul E. McKenney
2012-08-24  7:26 ` Mike Galbraith
2012-08-24 14:52   ` Paul E. McKenney
2012-08-24 15:40     ` Thomas Gleixner

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=CA+icZUXq9p4yOuse5dzCb2FGmgSKdU8ufDkDcTjWJ0dE79tvUg@mail.gmail.com \
    --to=sedat.dilek@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=paul.mckenney@linaro.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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).