lkml.org 
[lkml]   [2012]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/9] time: Reduce timekeeper read lock hold time
Date
Now that timekeeper updates are done with a shadow copy,
we can reduce the readlock hold time to only the update.

CC: Ingo Molnar <mingo@elte.hu>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
kernel/time/timekeeping.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index ed8cb51..97982b1 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1071,7 +1071,6 @@ static void update_wall_time(void)
s64 remainder;

spin_lock_irqsave(&timekeeper_wlock, flags);
- write_seqcount_begin(&timekeeper_rlock);

/* Make sure we're fully resumed: */
if (unlikely(timekeeping_suspended))
@@ -1155,13 +1154,13 @@ static void update_wall_time(void)
second_overflow();
}

-
+ write_seqcount_begin(&timekeeper_rlock);
timekeeper = shadow_tk;
timekeeper.clock->cycle_last = timekeeper.cycle_last;
timekeeping_update(&timekeeper, false);
+ write_seqcount_end(&timekeeper_rlock);

out:
- write_seqcount_end(&timekeeper_rlock);
spin_unlock_irqrestore(&timekeeper_wlock, flags);

}
--
1.7.3.2.146.gca209


\
 
 \ /
  Last update: 2012-03-02 08:17    [from the cache]
©2003-2011 Jasper Spaans