1. 26 5月, 2011 1 次提交
  2. 24 5月, 2011 4 次提交
  3. 22 8月, 2009 1 次提交
    • J
      time: Introduce CLOCK_REALTIME_COARSE · da15cfda
      john stultz 提交于
      After talking with some application writers who want very fast, but not
      fine-grained timestamps, I decided to try to implement new clock_ids
      to clock_gettime(): CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE
      which returns the time at the last tick. This is very fast as we don't
      have to access any hardware (which can be very painful if you're using
      something like the acpi_pm clocksource), and we can even use the vdso
      clock_gettime() method to avoid the syscall. The only trade off is you
      only get low-res tick grained time resolution.
      
      This isn't a new idea, I know Ingo has a patch in the -rt tree that made
      the vsyscall gettimeofday() return coarse grained time when the
      vsyscall64 sysctrl was set to 2. However this affects all applications
      on a system.
      
      With this method, applications can choose the proper speed/granularity
      trade-off for themselves.
      Signed-off-by: NJohn Stultz <johnstul@us.ibm.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: nikolag@ca.ibm.com
      Cc: Darren Hart <dvhltc@us.ibm.com>
      Cc: arjan@infradead.org
      Cc: jonathan@jonmasters.org
      LKML-Reference: <1250734414.6897.5.camel@localhost.localdomain>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      da15cfda
  4. 30 4月, 2009 1 次提交
    • J
      x86: gettimeofday() vDSO: fix segfault when tv == NULL · 2f65dd47
      John Wright 提交于
      According to the gettimeofday(2) manual:
      
             If either tv or tz is NULL, the corresponding structure is not
             set or returned.
      
      Since it is legal to give NULL as the tv argument, the code should make
      sure tv is not NULL before trying to dereference it.
      
      This issue manifests itself on x86_64 when vdso=0 is not on the kernel
      command-line and libc uses the vDSO for gettimeofday() (e.g. glibc >=
      2.7).  A simple reproducer:
      
        #include <stdio.h>
        #include <sys/time.h>
      
        int main(void)
        {
            struct timezone tz;
      
            gettimeofday(NULL, &tz);
      
            return 0;
        }
      
      See http://bugs.debian.org/466491 for more details.
      
      [ Impact: fix gettimeofday(NULL, &tz) segfault ]
      Signed-off-by: NJohn Wright <john.wright@hp.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: John Wright <john.wright@hp.com>
      LKML-Reference: <1241037121-14805-1-git-send-email-john.wright@hp.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2f65dd47
  5. 13 11月, 2008 1 次提交
  6. 12 11月, 2008 1 次提交
    • I
      tracing: branch tracer, fix vdso crash · 2b7d0390
      Ingo Molnar 提交于
      Impact: fix bootup crash
      
      the branch tracer missed arch/x86/vdso/vclock_gettime.c from
      disabling tracing, which caused such bootup crashes:
      
        [  201.840097] init[1]: segfault at 7fffed3fe7c0 ip 00007fffed3fea2e sp 000077
      
      also clean up the ugly ifdefs in arch/x86/kernel/vsyscall_64.c by
      creating DISABLE_UNLIKELY_PROFILE facility for code to turn off
      instrumentation on a per file basis.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2b7d0390
  7. 24 5月, 2008 1 次提交
  8. 23 5月, 2008 1 次提交
  9. 30 1月, 2008 1 次提交
  10. 11 10月, 2007 1 次提交
  11. 13 9月, 2007 1 次提交
  12. 22 7月, 2007 1 次提交
    • A
      x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu · 2aae950b
      Andi Kleen 提交于
      This implements new vDSO for x86-64.  The concept is similar
      to the existing vDSOs on i386 and PPC.  x86-64 has had static
      vsyscalls before,  but these are not flexible enough anymore.
      
      A vDSO is a ELF shared library supplied by the kernel that is mapped into
      user address space.  The vDSO mapping is randomized for each process
      for security reasons.
      
      Doing this was needed for clock_gettime, because clock_gettime
      always needs a syscall fallback and having one at a fixed
      address would have made buffer overflow exploits too easy to write.
      
      The vdso can be disabled with vdso=0
      
      It currently includes a new gettimeofday implemention and optimized
      clock_gettime(). The gettimeofday implementation is slightly faster
      than the one in the old vsyscall.  clock_gettime is significantly faster
      than the syscall for CLOCK_MONOTONIC and CLOCK_REALTIME.
      
      The new calls are generally faster than the old vsyscall.
      
      Advantages over the old x86-64 vsyscalls:
      - Extensible
      - Randomized
      - Cleaner
      - Easier to virtualize (the old static address range previously causes
      overhead e.g. for Xen because it has to create special page tables for it)
      
      Weak points:
      - glibc support still to be written
      
      The VM interface is partly based on Ingo Molnar's i386 version.
      
      Includes compile fix from Joachim Deguara
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2aae950b