Calling check_system_tsc_reliable before unsynchronized_tsc
PATCH 1/1 Calling check_system_tsc_reliable before unsynchronized_tsc
unsynchronized_tsc() checks value of tsc_clocksource_reliable which is set by check_system_tsc_reliable(). It's better to move check_system_tsc_reliable() at front, or else this check makes no sense.
Though X86_FEATURE_CONSTANT_TSC is usually set for TSC reliable system, just in case.
--- arch/x86/kernel/tsc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/tsc.c +2 -2
@@ -1412,11 +1412,11 @@ void __init tsc_init(void)use_tsc_delay (); +check_system_tsc_reliable (); +if (unsynchronized_tsc ())mark_tsc_unstable ("TSCs unsynchronized" ); -check_system_tsc_reliable (); -detect_art (); }
Signature · 1 line
1.7.3
Quoted 19 lines · Zhenzhong Duan
unsynchronized_tsc()checks value oftsc_clocksource_reliablewhich is set bycheck_system_tsc_reliable(). It's better to movecheck_system_tsc_reliable()at
front, or else this check makes no sense.Though
X86_FEATURE_CONSTANT_TSCis usually set for TSC reliable system, just in
case.Signed-off-by Zhenzhong Duan <[email protected]>--- arch/x86/kernel/tsc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)arch/x86/kernel/tsc.c +0
-0
arch/x86/kernel/tsc.c void __init tsc_init(void) · line 1417
Quoted 7 lines
arch/x86/kernel/tsc.c +1
-1@@ -1412,11 +1412,11 @@ void __init tsc_init(void)use_tsc_delay (); +check_system_tsc_reliable (); +if (unsynchronized_tsc ())mark_tsc_unstable ("TSCs unsynchronized" ); -check_system_tsc_reliable (); -
What kind of patch is that? Definitely nothing which can be applied.
Thanks,
tglx
Quoted 16 lines · Thomas Gleixner
Quoted 14 lines · Zhenzhong Duan
unsynchronized_tsc()checks value oftsc_clocksource_reliablewhich is set bycheck_system_tsc_reliable(). It's better to movecheck_system_tsc_reliable()at
front, or else this check makes no sense.Though
X86_FEATURE_CONSTANT_TSCis usually set for TSC reliable system, just in
case.Signed-off-by Zhenzhong Duan <[email protected]>--- arch/x86/kernel/tsc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Quoted 13 lines
arch/x86/kernel/tsc.c void __init tsc_init(void) · line 1417
Quoted 12 lines
arch/x86/kernel/tsc.c +1
-1@@ -1412,11 +1412,11 @@ void __init tsc_init(void)use_tsc_delay (); +check_system_tsc_reliable (); +if (unsynchronized_tsc ())mark_tsc_unstable ("TSCs unsynchronized" ); -check_system_tsc_reliable (); -What kind of patch is that? Definitely nothing which can be applied.
To avoid using unassigned variable tsc_clocksource_reliable.
Or what's the purpose of if (tsc_clocksource_reliable) check in unsynchronized_tsc()?
Signature · 2 lines
thanks zduan
Quoted 33 lines · Zhenzhong Duan
Quoted 19 lines · Thomas Gleixner
Quoted 17 lines · Zhenzhong Duan
unsynchronized_tsc()checks value oftsc_clocksource_reliablewhich is set bycheck_system_tsc_reliable(). It's better to movecheck_system_tsc_reliable()
at
front, or else this check makes no sense.Though
X86_FEATURE_CONSTANT_TSCis usually set for TSC reliable system, just
in
case.Signed-off-by Zhenzhong Duan <[email protected]>--- arch/x86/kernel/tsc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)Quoted 13 lines
arch/x86/kernel/tsc.c void __init tsc_init(void) · line 1417
Quoted 12 lines
arch/x86/kernel/tsc.c +1
-1@@ -1412,11 +1412,11 @@ void __init tsc_init(void)use_tsc_delay (); +check_system_tsc_reliable (); +if (unsynchronized_tsc ())mark_tsc_unstable ("TSCs unsynchronized" ); -check_system_tsc_reliable (); -What kind of patch is that? Definitely nothing which can be applied.
Quoted 3 lines
To avoid using unassigned variable
tsc_clocksource_reliable. Or what's the purpose of if (tsc_clocksource_reliable) check inunsynchronized_tsc()?
That's not the question. The patch format itself is broken:
@@ -1412,11 +1412,11 @@ void __init tsc_init(void)
use_tsc_delay();
+ check_system_tsc_reliable();
+
if (unsynchronized_tsc())
mark_tsc_unstable("TSCs unsynchronized");
- check_system_tsc_reliable();
-
That is not a patch created with diff -u or any other mechanism which creates properly formatted patches.
Thanks,
tglx