Feature #7805

want faster clock_gettime

Added by Patrick Mooney about 4 years ago. Updated almost 4 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


There is a large body of software today which calls clock_gettime() with extremely high frequency. On many operating systems, this functionality is implemented in such a way that it's performed entirely in userspace (via the vDSO on Linux), cutting down on the cost. This is not the case for illumos, which relies on the normal syscall path. On modern x86 hardware, clock_gettime() takes 30-50ns on Linux whereas on illumos, it's closer to 250ns+.

In order for software which heavily relies on frequent clock access, it would be nice to have access to the time via a userspace-only mechanism.
This has been implemented in SmartOS as OS-5192.
Various fixes and updates have been made to it in subsequent tickets.

Related issues

Related to illumos gate - Feature #11275: gettimeofday should use comm pageClosedPatrick Mooney

Related to illumos gate - Feature #12345: comm page should fallback to syscall after excessive migrationClosedPatrick Mooney


Updated by Patrick Mooney about 4 years ago

The to-be-upstreamed wad will be comprised of changes from the following SmartOS tickets:

    OS-5192 need faster clock_gettime
    OS-5515 segumap_fault can race for loaded mapping
    OS-5572 seg_umap should load mapping for F_SOFTLOCK
    OS-5637 lxbrand vdso busts golang stack budget
    OS-5451 comm page should not break i86xpv
    OS-5601 comm page symbols need ctf augmentation


Updated by Electric Monk about 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 2428aad8462660fad2b105777063fea6f4192308

commit  2428aad8462660fad2b105777063fea6f4192308
Author: Patrick Mooney <>
Date:   2017-02-27T19:49:06.000Z

    7805 want faster clock_gettime
    Reviewed by: Jerry Jelinek <>
    Reviewed by: Robert Mustacchi <>
    Reviewed by: Joshua M. Clulow <>
    Reviewed by: Ryan Zezeski <>
    Reviewed by: Dan McDonald <>
    Approved by: Garrett D'Amore <>


Updated by Electric Monk almost 4 years ago

git commit aa3c82a1eb83308d262b03dbffe9969658c7045b

commit  aa3c82a1eb83308d262b03dbffe9969658c7045b
Author: Yuri Pankov <>
Date:   2017-03-06T15:13:07.000Z

    7805 want faster clock_gettime (fix clean)


Updated by Joshua M. Clulow about 1 year ago


Updated by Patrick Mooney about 1 year ago

  • Related to Feature #12345: comm page should fallback to syscall after excessive migration added

Also available in: Atom PDF