From: Petr Mladek <pmladek@suse.com>
To: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Russell King <linux@arm.linux.org.uk>,
Thomas Gleixner <tglx@linutronix.de>,
Aaron Tomlin <atomlin@redhat.com>, Ingo Molnar <mingo@redhat.com>,
Andrew Morton <akpm@osdl.org>,
Daniel Thompson <daniel.thompson@linaro.org>,
x86@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH v8 4/4] nmi_backtrace: generate one-line reports for idle cpus
Date: Thu, 18 Aug 2016 17:12:11 +0200 [thread overview]
Message-ID: <20160818151211.GN13300@pathway.suse.cz> (raw)
In-Reply-To: <1471377024-2244-5-git-send-email-cmetcalf@mellanox.com>
On Tue 2016-08-16 15:50:24, Chris Metcalf wrote:
> When doing an nmi backtrace of many cores, most of which are idle,
> the output is a little overwhelming and very uninformative. Suppress
> messages for cpus that are idling when they are interrupted and just
> emit one line, "NMI backtrace for N skipped: idling at pc 0xNNN".
>
> We do this by grouping all the cpuidle code together into a new
> .cpuidle.text section, and then checking the address of the
> interrupted PC to see if it lies within that section.
>
> This commit suitably tags x86 and tile idle routines, and only
> adds in the minimal framework for other architectures.
>
> diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
> index b77f5edb03b0..4429f80aabcf 100644
> --- a/arch/x86/include/asm/irqflags.h
> +++ b/arch/x86/include/asm/irqflags.h
> @@ -1,6 +1,7 @@
> #ifndef _X86_IRQFLAGS_H_
> #define _X86_IRQFLAGS_H_
>
> +#include <linux/compiler.h>
> #include <asm/processor-flags.h>
>
> #ifndef __ASSEMBLY__
> @@ -44,12 +45,12 @@ static inline void native_irq_enable(void)
> asm volatile("sti": : :"memory");
> }
>
> -static inline void native_safe_halt(void)
> +static __always_inline void native_safe_halt(void)
> {
> asm volatile("sti; hlt": : :"memory");
> }
Ah, the __always_inline stuff did not helped here. It was
not inlined:
$> nm -n vmlinux | grep native_safe_halt
ffffffff81050bc0 t native_safe_halt
The reason seems to be that it is called via
PVOP_VCALL0(pv_irq_ops.safe_halt);, see below
in the disassembly.
I guess that it is because I have
CONFIG_PARAVIRT=y
void __cpuidle default_idle(void)
{
ffffffff819683f0: e8 2b 2a 00 00 callq ffffffff8196ae20 <__fentry__>
ffffffff819683f5: 55 push %rbp
ffffffff819683f6: 48 89 e5 mov %rsp,%rbp
ffffffff819683f9: 41 54 push %r12
ffffffff819683fb: 53 push %rbx
trace_cpu_idle_rcuidle(1, smp_processor_id());
ffffffff819683fc: 65 44 8b 25 0c 1d 6a mov %gs:0x7e6a1d0c(%rip),%r12d # a110 <cpu_number>
ffffffff81968403: 7e
ffffffff81968404: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
safe_halt();
ffffffff81968409: e8 a2 23 76 ff callq ffffffff810ca7b0 <trace_hardirqs_on>
}
#endif
static inline void arch_safe_halt(void)
{
PVOP_VCALL0(pv_irq_ops.safe_halt);
ffffffff8196840e: ff 14 25 80 a1 e2 81 callq *0xffffffff81e2a180
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
ffffffff81968415: 65 44 8b 25 f3 1c 6a mov %gs:0x7e6a1cf3(%rip),%r12d # a110 <cpu_number>
ffffffff8196841c: 7e
ffffffff8196841d: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
}
ffffffff81968422: 5b pop %rbx
ffffffff81968423: 41 5c pop %r12
ffffffff81968425: 5d pop %rbp
ffffffff81968426: c3 retq
ffffffff81968427: 65 8b 05 e2 1c 6a 7e mov %gs:0x7e6a1ce2(%rip),%eax # a110 <cpu_number>
ffffffff8196842e: 89 c0 mov %eax,%eax
Best Regards,
Petr
next prev parent reply other threads:[~2016-08-19 1:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1471377024-2244-1-git-send-email-cmetcalf@mellanox.com>
2016-08-16 19:50 ` [PATCH v8 1/4] nmi_backtrace: add more trigger_*_cpu_backtrace() methods Chris Metcalf
2016-08-18 14:12 ` Petr Mladek
2016-08-20 1:54 ` Chris Metcalf
2016-08-22 8:33 ` Petr Mladek
2016-08-16 19:50 ` [PATCH v8 2/4] nmi_backtrace: do a local dump_stack() instead of a self-NMI Chris Metcalf
2016-08-16 19:50 ` [PATCH v8 3/4] arch/tile: adopt the new nmi_backtrace framework Chris Metcalf
2016-08-16 19:50 ` [PATCH v8 4/4] nmi_backtrace: generate one-line reports for idle cpus Chris Metcalf
2016-08-18 15:12 ` Petr Mladek [this message]
2016-08-29 15:46 ` Chris Metcalf
2016-08-18 15:46 ` [PATCH v8 0/4] improvements to the nmi_backtrace code Daniel Thompson
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=20160818151211.GN13300@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@osdl.org \
--cc=atomlin@redhat.com \
--cc=cmetcalf@mellanox.com \
--cc=daniel.thompson@linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--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
all inboxes | Powered by JetHome®