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>,
"Ralf Baechle ralf @ linux-mips . org David S. Miller"
<davem@davemloft.net>,
linux-mips@linux-mips.org, sparclinux@vger.kernel.org,
x86@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 1/4] nmi_backtrace: add more trigger_*_cpu_backtrace() methods
Date: Thu, 18 Aug 2016 16:12:42 +0200 [thread overview]
Message-ID: <20160818141242.GK26194@pathway.suse.cz> (raw)
In-Reply-To: <1471377024-2244-2-git-send-email-cmetcalf@mellanox.com>
On Tue 2016-08-16 15:50:21, Chris Metcalf wrote:
> Currently you can only request a backtrace of either all cpus, or
> all cpus but yourself. It can also be helpful to request a remote
> backtrace of a single cpu, and since we want that, the logical
> extension is to support a cpumask as the underlying primitive.
>
> This change modifies the existing lib/nmi_backtrace.c code to take
> a cpumask as its basic primitive, and modifies the linux/nmi.h code
> to use the new "cpumask" method instead.
>
> The mips code ignored the "include_self" boolean but with this change
> it will now also dump a local backtrace if requested.
>
> diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
> index 7429ad09fbe3..fea1fa7726e3 100644
> --- a/arch/mips/kernel/process.c
> +++ b/arch/mips/kernel/process.c
> @@ -569,9 +569,16 @@ static void arch_dump_stack(void *info)
> dump_stack();
> }
>
> -void arch_trigger_all_cpu_backtrace(bool include_self)
> +void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self)
> {
> - smp_call_function(arch_dump_stack, NULL, 1);
> + long this_cpu = get_cpu();
> +
> + if (cpumask_test_cpu(this_cpu, mask) && !exclude_self)
> + dump_stack();
The bit is not cleared in the mask. Therefore arch_dump_stack
will get called for this CPU as well.
We could either use similar tricks as in lib/nmi_backtrace().
I mean to copy the mask into a global variable and prevent
parallel call with a backtrace_flag.
Or we could ignore the exclude_self flag as it was done
before. It is a separate problem after all and it need
not be solved in this patch(set).
> +
> + smp_call_function_many(mask, arch_dump_stack, NULL, 1);
> +
> + put_cpu();
> }
Otherwise the patch patch looks good to me.
Best Regards,
Petr
next prev parent reply other threads:[~2016-08-18 14:38 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 [this message]
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
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=20160818141242.GK26194@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=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=sparclinux@vger.kernel.org \
--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).