* [PATCH] time: Cleanup direct xtime usage in xen
@ 2010-01-29 4:24 John Stultz
0 siblings, 0 replies; 5+ messages in thread
From: John Stultz @ 2010-01-29 4:24 UTC (permalink / raw)
To: Jeremy Fitzhardinge, Chris Wright, linux-kernel; +Cc: John Stultz
Cleanup xen's direct use of internal timekeeping values.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
---
arch/x86/xen/time.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 0d3f07c..6365df9 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -475,6 +475,7 @@ void xen_timer_resume(void)
__init void xen_time_init(void)
{
int cpu = smp_processor_id();
+ struct timespec tp;
clocksource_register(&xen_clocksource);
@@ -486,9 +487,8 @@ __init void xen_time_init(void)
}
/* Set initial system time with full resolution */
- xen_read_wallclock(&xtime);
- set_normalized_timespec(&wall_to_monotonic,
- -xtime.tv_sec, -xtime.tv_nsec);
+ xen_read_wallclock(&tp);
+ do_settimeofday(&tp);
setup_force_cpu_cap(X86_FEATURE_TSC);
--
1.6.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] time: Cleanup warp_clock
@ 2010-03-04 3:11 John Stultz
2010-03-04 3:11 ` [PATCH] time: Cleanup direct xtime usage in xen John Stultz
0 siblings, 1 reply; 5+ messages in thread
From: John Stultz @ 2010-03-04 3:11 UTC (permalink / raw)
To: lkml; +Cc: John Stultz, Thomas Gleixner, Ingo Molnar, Andrew Morton
Not critical, 2.6.35 material.
warp_clock() currently accesses timekeeping internal state directly, which
is unnecessary. Convert it to use the proper timekeeping interfaces.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
---
kernel/time.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/kernel/time.c b/kernel/time.c
index 8047980..abe1c1b 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -133,12 +133,11 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
*/
static inline void warp_clock(void)
{
- write_seqlock_irq(&xtime_lock);
- wall_to_monotonic.tv_sec -= sys_tz.tz_minuteswest * 60;
- xtime.tv_sec += sys_tz.tz_minuteswest * 60;
- update_xtime_cache(0);
- write_sequnlock_irq(&xtime_lock);
- clock_was_set();
+ struct timespec delta, adjust;
+ delta.tv_sec = sys_tz.tz_minuteswest * 60;
+ delta.tv_nsec = 0;
+ adjust = timespec_add_safe(current_kernel_time(), delta);
+ do_settimeofday(&adjust);
}
/*
--
1.6.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] time: Cleanup direct xtime usage in xen
2010-03-04 3:11 [PATCH] time: Cleanup warp_clock John Stultz
@ 2010-03-04 3:11 ` John Stultz
2010-03-04 3:11 ` [PATCH] xtensa: Fix unnecessary setting of xtime John Stultz
2010-03-04 17:32 ` [PATCH] time: Cleanup direct xtime usage in xen Jeremy Fitzhardinge
0 siblings, 2 replies; 5+ messages in thread
From: John Stultz @ 2010-03-04 3:11 UTC (permalink / raw)
To: lkml; +Cc: John Stultz, Jeremy Fitzhardinge, Thomas Gleixner, Andrew Morton
Not critical, 2.6.35 material.
Cleanup xen's direct use of internal timekeeping values.
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
---
arch/x86/xen/time.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 0d3f07c..6365df9 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -475,6 +475,7 @@ void xen_timer_resume(void)
__init void xen_time_init(void)
{
int cpu = smp_processor_id();
+ struct timespec tp;
clocksource_register(&xen_clocksource);
@@ -486,9 +487,8 @@ __init void xen_time_init(void)
}
/* Set initial system time with full resolution */
- xen_read_wallclock(&xtime);
- set_normalized_timespec(&wall_to_monotonic,
- -xtime.tv_sec, -xtime.tv_nsec);
+ xen_read_wallclock(&tp);
+ do_settimeofday(&tp);
setup_force_cpu_cap(X86_FEATURE_TSC);
--
1.6.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] xtensa: Fix unnecessary setting of xtime
2010-03-04 3:11 ` [PATCH] time: Cleanup direct xtime usage in xen John Stultz
@ 2010-03-04 3:11 ` John Stultz
2010-03-04 17:32 ` [PATCH] time: Cleanup direct xtime usage in xen Jeremy Fitzhardinge
1 sibling, 0 replies; 5+ messages in thread
From: John Stultz @ 2010-03-04 3:11 UTC (permalink / raw)
To: lkml; +Cc: John Stultz, Thomas Gleixner, Andrew Morton, Chris Zankel
Not critical, 2.6.35 material.
xtensa supports read_persisitent_clock(), so there is no reason for
the arch specific code to be setting xtime. Setting xtime will be done
by the generic timekeeping code.
Please let me know if this is some sort of a workaround for an issue
instead of just an oversight.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
---
arch/xtensa/kernel/time.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index 19f7df3..19df764 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -60,11 +60,6 @@ static struct irqaction timer_irqaction = {
void __init time_init(void)
{
- /* FIXME: xtime&wall_to_monotonic are set in timekeeping_init. */
- read_persistent_clock(&xtime);
- set_normalized_timespec(&wall_to_monotonic,
- -xtime.tv_sec, -xtime.tv_nsec);
-
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
printk("Calibrating CPU frequency ");
platform_calibrate_ccount();
--
1.6.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] time: Cleanup direct xtime usage in xen
2010-03-04 3:11 ` [PATCH] time: Cleanup direct xtime usage in xen John Stultz
2010-03-04 3:11 ` [PATCH] xtensa: Fix unnecessary setting of xtime John Stultz
@ 2010-03-04 17:32 ` Jeremy Fitzhardinge
1 sibling, 0 replies; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2010-03-04 17:32 UTC (permalink / raw)
To: John Stultz; +Cc: lkml, Thomas Gleixner, Andrew Morton
On 03/03/2010 07:11 PM, John Stultz wrote:
> Not critical, 2.6.35 material.
>
> Cleanup xen's direct use of internal timekeeping values.
>
> Cc: Jeremy Fitzhardinge<jeremy@xensource.com>
> Cc: Thomas Gleixner<tglx@linutronix.de>
> Cc: Andrew Morton<akpm@linux-foundation.org>
> Signed-off-by: John Stultz<johnstul@us.ibm.com>
>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> ---
> arch/x86/xen/time.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
> index 0d3f07c..6365df9 100644
> --- a/arch/x86/xen/time.c
> +++ b/arch/x86/xen/time.c
> @@ -475,6 +475,7 @@ void xen_timer_resume(void)
> __init void xen_time_init(void)
> {
> int cpu = smp_processor_id();
> + struct timespec tp;
>
> clocksource_register(&xen_clocksource);
>
> @@ -486,9 +487,8 @@ __init void xen_time_init(void)
> }
>
> /* Set initial system time with full resolution */
> - xen_read_wallclock(&xtime);
> - set_normalized_timespec(&wall_to_monotonic,
> - -xtime.tv_sec, -xtime.tv_nsec);
> + xen_read_wallclock(&tp);
> + do_settimeofday(&tp);
>
> setup_force_cpu_cap(X86_FEATURE_TSC);
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-03-04 17:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-04 3:11 [PATCH] time: Cleanup warp_clock John Stultz
2010-03-04 3:11 ` [PATCH] time: Cleanup direct xtime usage in xen John Stultz
2010-03-04 3:11 ` [PATCH] xtensa: Fix unnecessary setting of xtime John Stultz
2010-03-04 17:32 ` [PATCH] time: Cleanup direct xtime usage in xen Jeremy Fitzhardinge
-- strict thread matches above, loose matches on Subject: below --
2010-01-29 4:24 John Stultz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox