lkml.org 
[lkml]   [2012]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/7] 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: 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 | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index ebfb037..5a444b8 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1062,7 +1062,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))
@@ -1145,13 +1144,18 @@ static void update_wall_time(void)
second_overflow();
}

-
+ write_seqcount_begin(&timekeeper.rlock);
+ /*
+ * We have to store rlock back to tk, otherwise we'll
+ * corrupt the timeekeerp.rlock when we copy over timekeeper
+ */
+ tk.rlock = timekeeper.rlock;
timekeeper = 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-02-28 01:33    [W:0.055 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site