From: Andrew Morton <akpm@linux-foundation.org>
To: Song Liu <song@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <kernel-team@meta.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] watchdog: Prefer use "ref-cycles" for NMI watchdog
Date: Fri, 12 May 2023 16:40:56 -0700 [thread overview]
Message-ID: <20230512164056.8f1e4e23032f7f7f5cb69df0@linux-foundation.org> (raw)
In-Reply-To: <20230509221700.859865-1-song@kernel.org>
On Tue, 9 May 2023 15:17:00 -0700 Song Liu <song@kernel.org> wrote:
> NMI watchdog permanently consumes one hardware counters per CPU on the
> system. For systems that use many hardware counters, this causes more
> aggressive time multiplexing of perf events.
>
> OTOH, some CPUs (mostly Intel) support "ref-cycles" event, which is rarely
> used. Try use "ref-cycles" for the watchdog. If the CPU supports it, so
> that one more hardware counter is available to the user. If the CPU doesn't
> support "ref-cycles", fall back to "cycles".
>
> The downside of this change is that users of "ref-cycles" need to disable
> nmi_watchdog.
>
> ...
>
> @@ -286,6 +286,12 @@ int __init hardlockup_detector_perf_init(void)
> {
> int ret = hardlockup_detector_event_create();
>
> + if (ret) {
If we get here, hardlockup_detector_event_create() has sent a scary
pr_debug message.
> + /* Failed to create "ref-cycles", try "cycles" instead */
> + wd_hw_attr.config = PERF_COUNT_HW_CPU_CYCLES;
> + ret = hardlockup_detector_event_create();
So it would be good to emit a followup message here telling users that
things are OK. Or tell the user we're retrying with a different
counter, etc.
> + /* Failed to create "ref-cycles", try "cycles" instead */
> + wd_hw_attr.config = PERF_COUNT_HW_CPU_CYCLES;
> + ret = hardlockup_detector_event_create();
> + }
> +
> if (ret) {
> pr_info("Perf NMI watchdog permanently disabled\n");
> } else {
> --
> 2.34.1
next prev parent reply other threads:[~2023-05-12 23:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 22:17 Song Liu
2023-05-12 12:46 ` Peter Zijlstra
2023-05-12 16:43 ` Song Liu
2023-05-15 10:33 ` Peter Zijlstra
2023-05-15 20:33 ` Song Liu
2023-05-12 23:40 ` Andrew Morton [this message]
2023-05-13 0:03 ` Song Liu
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=20230512164056.8f1e4e23032f7f7f5cb69df0@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=song@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®