Commit:     2008220879af095d00ca27eb168a55c8595fbc0b
Parent:     1d4ec7b1d6f130818f9b62dea3411d9ee2ff6ff6
Author:     Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Fri Jul 20 13:28:54 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Jul 20 13:32:46 2007 -0700

    Revert "sys_time() speedup"
    This basically reverts commit 4e44f3497d41db4c3b9051c61410dee8ae4fb49c,
    while waiting for it to be re-done more completely.  There are cases of
    people mixing "time()" with higher-resolution time sources, and we need
    to take the nanosecond offsets into account.
    Ingo has a patch that does that, but it's still under some discussion.
    In the meantime, just revert back to the old simple situation of just
    doing the whole exact timesource calculations.
    But rather than using do_gettimeofday(), use the internal nanosecond
    resolution getnstimeofday(), which at least avoids one unnecessary
    conversion (since we really don't care about whether the fractional
    seconds are nanoseconds or microseconds - we'll just throw them away).
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 kernel/time.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/kernel/time.c b/kernel/time.c
index e325597..5b81da0 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -57,17 +57,14 @@ EXPORT_SYMBOL(sys_tz);
 asmlinkage long sys_time(time_t __user * tloc)
-       /*
-        * We read xtime.tv_sec atomically - it's updated
-        * atomically by update_wall_time(), so no need to
-        * even read-lock the xtime seqlock:
-        */
-       time_t i = xtime.tv_sec;
+       time_t i;
+       struct timespec tv;
-       smp_rmb(); /* sys_time() results are coherent */
+       getnstimeofday(&tv);
+       i = tv.tv_sec;
        if (tloc) {
-               if (put_user(i, tloc))
+               if (put_user(i,tloc))
                        i = -EFAULT;
        return i;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to