3.2. MRG Realtime Specific gettimeofday speedup

3.2. MRG Realtime Specific gettimeofday speedup

In addition to the gettimeofday(2) speedup listed in Section 2.5, “gettimeofday speedup”, the MRG Realtime kernel contains a further gettimeofday performance optimization. This method caches the most recently used time value in a global system file. If another gettimeofday call is performed within the ms (hz) then it is not necessary re-read the hardware clock. As a result, applications which do not require microsecond precision benefit.

Enable the MRG Realtime gettimeofday speedup

This setting is not enabled by default. When you start it, it needs to be enabled on a global basis.

  1. Firstly you will need to append the line “kernel.vsyscall64 = 2” to the /etc/sysctl.conf file. This causes the gettimeofday function to be performed entirely in user-space, removing the system call overhead.

    echo "kernel.vsyscall64 = 2" >> /etc/sysctl.conf
    
  2. To make the change effective immediately and persistent between reboots, use the -w option with the sysctl command to update the setting:

    /sbin/sysctl -w kernel.vsyscall64=2
    

Related Manual Pages

For more information, or for further reading, the following man pages are related to the information given in this section.