From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754734AbcHSBdv (ORCPT ); Thu, 18 Aug 2016 21:33:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:35247 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754924AbcHSBds (ORCPT ); Thu, 18 Aug 2016 21:33:48 -0400 Date: Thu, 18 Aug 2016 17:12:11 +0200 From: Petr Mladek To: Chris Metcalf Cc: Peter Zijlstra , "Rafael J. Wysocki" , Russell King , Thomas Gleixner , Aaron Tomlin , Ingo Molnar , Andrew Morton , Daniel Thompson , 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 Message-ID: <20160818151211.GN13300@pathway.suse.cz> References: <1471377024-2244-1-git-send-email-cmetcalf@mellanox.com> <1471377024-2244-5-git-send-email-cmetcalf@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471377024-2244-5-git-send-email-cmetcalf@mellanox.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > #include > > #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 ffffffff81968403: 7e ffffffff81968404: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) safe_halt(); ffffffff81968409: e8 a2 23 76 ff callq ffffffff810ca7b0 } #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 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 ffffffff8196842e: 89 c0 mov %eax,%eax Best Regards, Petr