1. 27 Jul, 2010 5 commits
    • 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 35 commits