CLOCK_BOOTIME (commit cf87f8587)

Volker Lendecke vl at samba.org
Mon Aug 1 13:00:16 UTC 2016


Hi, Simo!

Just talked to Björn Jacke: He told me that commit cf87f8587 was
triggered by a suggestion you made. CLOCK_BOOTTIME is the better
alternative than CLOCK_MONOTONIC. I don't fully understand it, but
what I get is that CLOCK_BOOTTIME correctly takes care of a machine in
suspend mode.

This of course makes a lot of sense for laptops, but it comes at
a cost: If I run the attached program on a PPC machine I get that
calling CLOCK_BOOTTIME is roughly 8 times more expensive than calling
CLOCK_MONOTONIC. Christof Schmitt has figured out that this is due to
CLOCK_BOOTTIME being a real syscall whereas CLOCK_MONOTONIC is a pure
read from a kernel page like getpid() is.

[root at p8-10-rhel-71be-01 vlendeke]# time ./timetest 100000000
real    0m26.443s
user    0m7.298s
sys     0m19.145s
[root at p8-10-rhel-71be-01 vlendeke]# time ./timetest 100000000 mono
real    0m3.253s
user    0m3.244s
sys     0m0.010s

Simo, do you really see the need for CLOCK_BOOTTIME for your RHEL
deployments? Or could you live with CLOCK_MONOTONIC only?

If your customers need CLOCK_BOOTTIME, has RedHat the capability to
make CLOCK_BOOTTIME a kernel page read too, so that it is just as
cheap as CLOCK_MONOTONIC?

Thanks, Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timetest.c
Type: text/x-csrc
Size: 570 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160801/fde71bc3/timetest.c>


More information about the samba-technical mailing list