1. 27 Jul, 2010 8 commits
    • John Stultz's avatar
      hrtimer: Cleanup direct access to wall_to_monotonic · 8ab4351a
      John Stultz authored
      Provides an accessor function to replace hrtimer.c's
      direct access of wall_to_monotonic.
      
      This will allow wall_to_monotonic to be made static as
      planned in Documentation/feature-removal-schedule.txt
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      LKML-Reference: <1279068988-21864-9-git-send-email-johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      8ab4351a
    • John Stultz's avatar
      um: Convert to use read_persistent_clock · 9f31f577
      John Stultz authored
      This patch converts the um arch to use read_persistent_clock().
      This allows it to avoid accessing xtime and wall_to_monotonic
      directly.
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      LKML-Reference: <1279068988-21864-8-git-send-email-johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      9f31f577
    • John Stultz's avatar
      timkeeping: Fix update_vsyscall to provide wall_to_monotonic offset · 7615856e
      John Stultz authored
      update_vsyscall() did not provide the wall_to_monotoinc offset,
      so arch specific implementations tend to reference wall_to_monotonic
      directly. This limits future cleanups in the timekeeping core, so
      this patch fixes the update_vsyscall interface to provide
      wall_to_monotonic, allowing wall_to_monotonic to be made static
      as planned in Documentation/feature-removal-schedule.txt
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Tony Luck <tony.luck@intel.com>
      LKML-Reference: <1279068988-21864-7-git-send-email-johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      7615856e
    • John Stultz's avatar
      powerpc: Cleanup xtime usage · 06d518e3
      John Stultz authored
      This removes powerpc's direct xtime usage, allowing for further
      generic timeekeping cleanups
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      LKML-Reference: <1279068988-21864-6-git-send-email-johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      06d518e3
    • John Stultz's avatar
      powerpc: Simplify update_vsyscall · b0797b60
      John Stultz authored
      Currently powerpc's update_vsyscall calls an inline update_gtod.
      However, both are straightforward, and there are no other users,
      so this patch merges update_gtod into update_vsyscall.
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1279068988-21864-5-git-send-email-johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      b0797b60
    • John Stultz's avatar
      time: Kill off CONFIG_GENERIC_TIME · 592913ec
      John Stultz authored
      Now that all arches have been converted over to use generic time via
      clocksources or arch_gettimeoffset(), we can remove the GENERIC_TIME
      config option and simplify the generic code.
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      LKML-Reference: <1279068988-21864-4-git-send-email-johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      592913ec
    • John Stultz's avatar
      time: Implement timespec_add · ce3bf7ab
      John Stultz authored
      After accidentally misusing timespec_add_safe, I wanted to make sure
      we don't accidently trip over that issue again, so I created a simple
      timespec_add() function which we can use to replace the instances
      of timespec_add_safe() that don't want the overflow detection.
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      LKML-Reference: <1279068988-21864-3-git-send-email-johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      ce3bf7ab
    • John Stultz's avatar
      x86: Fix vtime/file timestamp inconsistencies · 8c73626a
      John Stultz authored
      Due to vtime calling vgettimeofday(), its possible that an application
      could call  time();create("stuff",O_RDRW);  only to see the file's
      creation timestamp to be before the value returned by time.
      
      A similar way to reproduce the issue is to compare the vsyscall time()
      with the syscall time(), and observe ordering issues.
      
      The modified test case from Oleg Nesterov below can illustrate this:
      
      int main(void)
      {
      	time_t sec1,sec2;
      	do {
      		sec1 = time(&sec2);
      		sec2 = syscall(__NR_time, NULL);
      	} while (sec1 <= sec2);
      
      	printf("vtime: %d.000000\n", sec1);
      	printf("time: %d.000000\n", sec2);
      	return 0;
      }
      
      The proper fix is to make vtime use the same time value as
      current_kernel_time() (which is exported via update_vsyscall) instead of
      vgettime().
      
      Thanks to Jiri Olsa for bringing up the issue and catching bugs in
      earlier verisons of this fix.
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      LKML-Reference: <1279068988-21864-2-git-send-email-johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      8c73626a
  2. 26 Jul, 2010 32 commits