I think clock_gettime is already almost as fast as possible, but every
little bit helps. Also, I think the diffstat is pretty good for a
speedup. Here are some approximate timings.
Before After
CLOCK_REALTIME 16.7 15.2
CLOCK_MONOTONIC 17.3 15.5
CLOCK_REALTIME_COARSE 3.6 3.0
CLOCK_MONOTONIC_COARSE 4.2 3.6
These are extracted from an earlier series that's mostly abandoned now [1-2].
They apply to tip/timers/core commit 57779dc2b3b75bee05ef5d1ada47f615f7a13932.
For the git-inclined, the patches are here:
https://git.kernel.org/?p=linux/kernel/git/luto/linux.git;a=shortlog;h=refs/heads/timing/vclock_speedup/patch_v1
I'm not sure whether these are 3.4 material. On the pro side, they've
technically been floating around since long before the merge window.
They're also quite straightforward, and they're based on other -tip
changes (which is why I'm submitting now). On the con side, they don't
fix anything, and they're a little later than ideal.