mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: paulmck@kernel.org, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, john.stultz@linaro.org,
	sboyd@kernel.org, corbet@lwn.net, Mark.Rutland@arm.com,
	maz@kernel.org, kernel-team@meta.com, neeraju@codeaurora.org,
	ak@linux.intel.com, feng.tang@intel.com, zhengjun.xing@intel.com
Subject: Re: PATCH v2 clocksource 8/7] clocksource: Enable TSC watchdog checking of HPET and PMTMR only when requested
Date: Mon, 6 Feb 2023 14:57:55 -0500	[thread overview]
Message-ID: <82e4dae9-0aca-a06b-cb0d-5a189998cdc1@redhat.com> (raw)
In-Reply-To: <20230203043658.GA1513624@paulmck-ThinkPad-P17-Gen-1>

On 2/2/23 23:36, Paul E. McKenney wrote:
> Unconditionally enabling TSC watchdog checking of the HPET and PMTMR
> clocksources can degrade latency and performance.  Therefore, provide
> a new "watchdog" option to the tsc= boot parameter that opts into such
> checking.  Note that tsc=watchdog is overridden by a tsc=nowatchdog
> regardless of their relative positions in the list of boot parameters.
>
> Reported-by: Thomas Gleixner <tglx@linutronix.de>
> Reported-by: Waiman Long <longman@redhat.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 95f0d104c2322..7b4df6d89d3c3 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -6373,6 +6373,12 @@
>   			(HPET or PM timer) on systems whose TSC frequency was
>   			obtained from HW or FW using either an MSR or CPUID(0x15).
>   			Warn if the difference is more than 500 ppm.
> +			[x86] watchdog: Use TSC as the watchdog clocksource with
> +			which to check other HW timers (HPET or PM timer), but
> +			only on systems where TSC has been deemed trustworthy.
> +			This will be suppressed by an earlier tsc=nowatchdog and
> +			can be overridden by a later tsc=nowatchdog.  A console
> +			message will flag any such suppression or overriding.
>   
>   	tsc_early_khz=  [X86] Skip early TSC calibration and use the given
>   			value instead. Useful when the early TSC frequency discovery
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index a5371c6d4b64b..306c233c98d84 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -294,6 +294,7 @@ __setup("notsc", notsc_setup);
>   
>   static int no_sched_irq_time;
>   static int no_tsc_watchdog;
> +static int tsc_as_watchdog;
>   
>   static int __init tsc_setup(char *str)
>   {
> @@ -303,10 +304,22 @@ static int __init tsc_setup(char *str)
>   		no_sched_irq_time = 1;
>   	if (!strcmp(str, "unstable"))
>   		mark_tsc_unstable("boot parameter");
> -	if (!strcmp(str, "nowatchdog"))
> +	if (!strcmp(str, "nowatchdog")) {
>   		no_tsc_watchdog = 1;
> +		if (tsc_as_watchdog)
> +			pr_alert("%s: Overriding earlier tsc=watchdog with tsc=nowatchdog\n",
> +				 __func__);
> +		tsc_as_watchdog = 0;
> +	}
>   	if (!strcmp(str, "recalibrate"))
>   		tsc_force_recalibrate = 1;
> +	if (!strcmp(str, "watchdog")) {
> +		if (no_tsc_watchdog)
> +			pr_alert("%s: tsc=watchdog overridden by earlier tsc=nowatchdog\n",
> +				 __func__);
> +		else
> +			tsc_as_watchdog = 1;
> +	}
>   	return 1;
>   }
>   
> @@ -1192,7 +1205,8 @@ static void __init tsc_disable_clocksource_watchdog(void)
>   
>   bool tsc_clocksource_watchdog_disabled(void)
>   {
> -	return !(clocksource_tsc.flags & CLOCK_SOURCE_MUST_VERIFY);
> +	return !(clocksource_tsc.flags & CLOCK_SOURCE_MUST_VERIFY) &&
> +	       tsc_as_watchdog && !no_tsc_watchdog;
>   }
>   
>   static void __init check_system_tsc_reliable(void)
>
Acked-by: Waiman Long <longman@redhat.com>


  reply	other threads:[~2023-02-06 19:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25  0:27 [PATCH clocksource v2 0/7] Clocksource watchdog updates for v6.3 Paul E. McKenney
2023-01-25  0:27 ` [PATCH v2 clocksource 1/7] clocksource: Print clocksource name when clocksource is tested unstable Paul E. McKenney
2023-01-25  0:27 ` [PATCH v2 clocksource 2/7] clocksource: Loosen clocksource watchdog constraints Paul E. McKenney
2023-01-25  0:27 ` [PATCH v2 clocksource 3/7] clocksource: Improve read-back-delay message Paul E. McKenney
2023-01-25  0:27 ` [PATCH v2 clocksource 4/7] clocksource: Improve "skew is too large" messages Paul E. McKenney
2023-01-25  0:27 ` [PATCH v2 clocksource 5/7] clocksource: Suspend the watchdog temporarily when high read latency detected Paul E. McKenney
2023-01-25  0:27 ` [PATCH v2 clocksource 6/7] clocksource: Verify HPET and PMTMR when TSC unverified Paul E. McKenney
2023-01-26 10:57   ` Daniel Lezcano
2023-02-01  0:50     ` Paul E. McKenney
2023-02-01 10:24   ` Thomas Gleixner
2023-02-01 15:10     ` Feng Tang
2023-02-01 19:26     ` Waiman Long
2023-02-01 19:55       ` Paul E. McKenney
2023-02-02  3:40         ` Waiman Long
2023-02-02  4:54           ` Paul E. McKenney
2023-02-02  7:57           ` Thomas Gleixner
2023-02-04  1:27             ` Paul E. McKenney
2023-02-01 19:51     ` Paul E. McKenney
2023-01-25  0:27 ` [PATCH v2 clocksource 7/7] x86/tsc: Add option to force frequency recalibration with HW timer Paul E. McKenney
2023-02-03  4:36 ` PATCH v2 clocksource 8/7] clocksource: Enable TSC watchdog checking of HPET and PMTMR only when requested Paul E. McKenney
2023-02-06 19:57   ` Waiman Long [this message]
2023-02-07  1:08     ` Paul E. McKenney

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=82e4dae9-0aca-a06b-cb0d-5a189998cdc1@redhat.com \
    --to=longman@redhat.com \
    --cc=Mark.Rutland@arm.com \
    --cc=ak@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=feng.tang@intel.com \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=neeraju@codeaurora.org \
    --cc=paulmck@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zhengjun.xing@intel.com \
    /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®