mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Guillaume Chazarain" <guichaz@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>, "Andi Kleen" <ak@suse.de>,
	linux-kernel@vger.kernel.org
Subject: [2/3] Cleanup: Unify tsc_unstable and tsc_disable
Date: Sat, 3 Mar 2007 22:41:41 +0100	[thread overview]
Message-ID: <3d8471ca0703031341tb017419jb6507c3f6f662ef0@mail.gmail.com> (raw)

tsc_unstable and tsc_disable serve the same purpose.

Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
---

diff -r 6cd70e2b4c1f arch/i386/kernel/tsc.c
--- a/arch/i386/kernel/tsc.c	Sat Mar 03 21:39:09 2007 +0100
+++ b/arch/i386/kernel/tsc.c	Sat Mar 03 22:13:03 2007 +0100
@@ -49,16 +49,6 @@ static int __init tsc_setup(char *str)

 __setup("notsc", tsc_setup);

-/*
- * code to mark and check if the TSC is unstable
- * due to cpufreq or due to unsynced TSCs
- */
-static int tsc_unstable;
-
-static inline int check_tsc_unstable(void)
-{
-	return tsc_unstable;
-}

 /* Accellerators for sched_clock()
  * convert from cycles(64bits) => nanoseconds (64bits)
@@ -108,7 +98,7 @@ unsigned long long sched_clock(void)
 	/*
 	 * Fall back to jiffies if there's no TSC available:
 	 */
-	if (tsc_unstable || unlikely(tsc_disable))
+	if (unlikely(tsc_disable))
 		/* No locking but a rare wrong value is not a big deal: */
 		return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);

@@ -312,8 +302,8 @@ static struct clocksource clocksource_ts

 void mark_tsc_unstable(void)
 {
-	if (!tsc_unstable) {
-		tsc_unstable = 1;
+	if (!tsc_disable) {
+		tsc_disable = 1;
 		/* Can be called before registration */
 		if (clocksource_tsc.mult)
 			clocksource_change_rating(&clocksource_tsc, 0);
@@ -327,7 +317,7 @@ static int __init dmi_mark_tsc_unstable(
 {
 	printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
 		       d->ident);
-	tsc_unstable = 1;
+	tsc_disable = 1;
 	return 0;
 }

@@ -350,7 +340,7 @@ static struct dmi_system_id __initdata b
  */
 __cpuinit int unsynchronized_tsc(void)
 {
-	if (!cpu_has_tsc || tsc_unstable)
+	if (!cpu_has_tsc || tsc_disable)
 		return 1;
 	/*
 	 * Intel systems are normally all synchronized.
@@ -359,9 +349,9 @@ __cpuinit int unsynchronized_tsc(void)
 	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
 		/* assume multi socket systems are not synchronized: */
 		if (num_possible_cpus() > 1)
-			tsc_unstable = 1;
-	}
-	return tsc_unstable;
+			tsc_disable = 1;
+	}
+	return tsc_disable;
 }

 /*
@@ -396,7 +386,7 @@ static int __init init_tsc_clocksource(v
 		clocksource_tsc.mult = clocksource_khz2mult(current_tsc_khz,
 							clocksource_tsc.shift);
 		/* lower the rating if we already know its unstable: */
-		if (check_tsc_unstable()) {
+		if (tsc_disable) {
 			clocksource_tsc.rating = 0;
 			clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS;
 		}


-- 
Guillaume

                 reply	other threads:[~2007-03-03 21:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3d8471ca0703031341tb017419jb6507c3f6f662ef0@mail.gmail.com \
    --to=guichaz@gmail.com \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®