public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Chris Metcalf <cmetcalf@mellanox.com>, lorenzo.pieralisi@arm.com
Cc: Peter Zijlstra <peterz@infradead.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Petr Mladek <pmladek@suse.com>,
	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 v7 4/4] nmi_backtrace: generate one-line reports for idle cpus
Date: Mon, 8 Aug 2016 17:48:28 +0100	[thread overview]
Message-ID: <20160808164828.GH12649@leverpostej> (raw)
In-Reply-To: <1470672218-16059-5-git-send-email-cmetcalf@mellanox.com>

Hi,

[adding Lorenzo]

On Mon, Aug 08, 2016 at 12:03:38PM -0400, 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, arm64, and tile idle routines,
> and only adds in the minimal framework for other architectures.

> diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
> index 659963d40bb4..fe7f93b7b11b 100644
> --- a/arch/arm64/kernel/vmlinux.lds.S
> +++ b/arch/arm64/kernel/vmlinux.lds.S
> @@ -122,6 +122,7 @@ SECTIONS
>  			ENTRY_TEXT
>  			TEXT_TEXT
>  			SCHED_TEXT
> +			CPUIDLE_TEXT
>  			LOCK_TEXT
>  			KPROBES_TEXT
>  			HYPERVISOR_TEXT
> diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
> index 5bb61de23201..64f088ca3192 100644
> --- a/arch/arm64/mm/proc.S
> +++ b/arch/arm64/mm/proc.S
> @@ -48,11 +48,13 @@
>   *
>   *	Idle the processor (wait for interrupt).
>   */
> +	.pushsection ".cpuidle.text","ax"
>  ENTRY(cpu_do_idle)
>  	dsb	sy				// WFI may enter a low-power mode
>  	wfi
>  	ret
>  ENDPROC(cpu_do_idle)
> +	.popsection

>From a quick scan it looks like we only call this with interrupts
disabled, and we have no NMI. So shouldn't we be annotating
arch_cpu_idle(), which calls this and subsequently enables interrupts?

I'm also not sure what you need to do for PSCI, which is the preferred
(FW-backed) idle mechanism for arm64. The infrastrucure for that is
spread over a few files:

  arch/arm64/kernel/sleep.S
  arch/arm64/kernel/smccc-call.S
  arch/arm64/kernel/suspend.c
  drivers/cpuidle/cpuidle-arm.c
  drivers/firmware/psci.c

I'm not sure where we'd be an an interruptible state, and therefore I'm
not immediately sure what we should annotate.

Thanks,
Mark.

  reply	other threads:[~2016-08-08 16:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 16:03 [PATCH v7 0/4] improvements to the nmi_backtrace code Chris Metcalf
2016-08-08 16:03 ` [PATCH v7 1/4] nmi_backtrace: add more trigger_*_cpu_backtrace() methods Chris Metcalf
2016-08-09 12:35   ` Petr Mladek
2016-08-08 16:03 ` [PATCH v7 2/4] nmi_backtrace: do a local dump_stack() instead of a self-NMI Chris Metcalf
2016-08-09 12:37   ` Petr Mladek
2016-08-08 16:03 ` [PATCH v7 3/4] arch/tile: adopt the new nmi_backtrace framework Chris Metcalf
2016-08-08 16:03 ` [PATCH v7 4/4] nmi_backtrace: generate one-line reports for idle cpus Chris Metcalf
2016-08-08 16:48   ` Mark Rutland [this message]
2016-08-09 10:37     ` Lorenzo Pieralisi
2016-08-09 13:25       ` Chris Metcalf
2016-08-09 12:43   ` Petr Mladek
2016-08-09 16:43     ` Chris Metcalf
2016-08-11 15:25       ` Petr Mladek
2016-08-11 15:36         ` Peter Zijlstra
2016-08-15 16:41         ` Chris Metcalf
2016-08-16  8:04           ` Petr Mladek

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=20160808164828.GH12649@leverpostej \
    --to=mark.rutland@arm.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=lorenzo.pieralisi@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --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