lkml.org 
[lkml]   [2011]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 7/7] timekeeping: Reduce seqcount section to update timekeeper/xtime
The calculation of the timekeeping values is now decoupled from
timekeeper/xtime which are used by the readers. So we can confine the
seqcount section to the mere update of the reader side data.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/time/timekeeping.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Index: linux-2.6-tip/kernel/time/timekeeping.c
===================================================================
--- linux-2.6-tip.orig/kernel/time/timekeeping.c
+++ linux-2.6-tip/kernel/time/timekeeping.c
@@ -986,7 +986,10 @@ static void update_wall_time(void)
xtime_calc.tv_sec++;
second_overflow();
}
+}

+static void update_timekeeper(void)
+{
timekeeper = tk_calc;
xtime = xtime_calc;

@@ -1126,10 +1129,13 @@ struct timespec get_monotonic_coarse(voi
*/
void do_timer(unsigned long ticks)
{
+ update_wall_time();
+
write_seqcount_begin(&xtime_seq);
jiffies_64 += ticks;
- update_wall_time();
+ update_timekeeper();
write_seqcount_end(&xtime_seq);
+
calc_global_load(ticks);
}




\
 
 \ /
  Last update: 2011-11-14 00:23    [W:0.066 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site