Re: clock_gettime_ns

From: Arun Sharma
Date: Thu Sep 05 2013 - 01:12:15 EST


On 9/5/13 12:47 AM, John Stultz wrote:
If we're going to add a new interface that uses something other then a
timespec, we likely need to put some serious thought into that new
type, and see how it could be used across a number of syscalls. Some
of the discussion around dealing with the 2038 issue touched on this.

[ I know you're not asking for perf data, but may be useful for new readers ]

Here's the benchmarking I did in 2011:

http://thread.gmane.org/gmane.linux.kernel/1233758/focus=1233781

Switching from timespec to s64 was worth 21%. My experience over the years is that this performance delta causes userspace guys to implement their own TSC based timers, against the advice from kernel developers.

http://code.ohloh.net/search?s=wall%20now%20tsc%20hz&pp=0&fl=C&fl=C%2B%2B&ff=1&mp=1&ml=1&me=1&md=1&filterChecked=true

I worry that trying to solve other clock problems will cause the kernel to continue to pass the time in memory instead of registers, giving the userspace TSC based implementations a reason to exist.

-Arun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/