mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	diego.viola@gmail.com, len.brown@intel.com, rjw@rjwysocki.net,
	rui.zhang@intel.com
Subject: [PATCH 5/5] clocksource: Consistent de-rate when marking unstable
Date: Mon, 23 Apr 2018 18:16:53 +0200	[thread overview]
Message-ID: <20180423162642.218493878@infradead.org> (raw)
In-Reply-To: <20180423161648.622657048@infradead.org>

[-- Attachment #1: peterz-tsc-early-fix-5.patch --]
[-- Type: text/plain, Size: 951 bytes --]

When we mark a registered clocksource unstable the watchdog_kthread
will de-rate and re-select the clocksource. Ensure we also de-rate
when getting called on an unregistered clocksource.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 kernel/time/clocksource.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -152,12 +152,19 @@ static void __clocksource_unstable(struc
 	cs->flags &= ~(CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_WATCHDOG);
 	cs->flags |= CLOCK_SOURCE_UNSTABLE;
 
-	if (list_empty(&cs->list))
+	/*
+	 * If the clocksource is registered clocksource_watchdog_kthread() will
+	 * re-rate and re-select.
+	 */
+	if (list_empty(&cs->list)) {
+		cs->rating = 0;
 		return;
+	}
 
 	if (cs->mark_unstable)
 		cs->mark_unstable(cs);
 
+	/* kick clocksource_watchdog_kthread() */
 	if (finished_booting)
 		schedule_work(&watchdog_work);
 }

      parent reply	other threads:[~2018-04-23 16:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 16:16 [PATCH 0/5] Various tsc/clocksource fixes Peter Zijlstra
2018-04-23 16:16 ` [PATCH 1/5] x86,tsc: Always unregister clocksource_tsc_early Peter Zijlstra
2018-04-23 16:16 ` [PATCH 2/5] clocksource: Allow clocksource_mark_unstable() on unregisered clocksources Peter Zijlstra
2018-04-23 16:41   ` Peter Zijlstra
2018-04-23 16:43     ` Peter Zijlstra
2018-04-23 16:16 ` [PATCH 3/5] clocksource: Initialize cs->wd_list Peter Zijlstra
2018-04-23 16:16 ` [PATCH 4/5] x86,tsc: Fix mark_tsc_unstable() Peter Zijlstra
2018-04-23 16:16 ` Peter Zijlstra [this message]

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=20180423162642.218493878@infradead.org \
    --to=peterz@infradead.org \
    --cc=diego.viola@gmail.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=tglx@linutronix.de \
    /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®