Implementing virtual system calls
Implementing virtual system calls
Posted Oct 16, 2014 16:03 UTC (Thu) by ntl (subscriber, #40518)Parent article: Implementing virtual system calls
Some info worth adding here...
vDSO implementations of the APIs for sampling high resolution timestamps (gettimeofday and clock_gettime w/CLOCK_REALTIME, CLOCK_MONOTONIC) depend on user space access to a high resolution counter (e.g. TSC). This is used to calculate the time elapsed since the last time the kernel updated the data page, and mirrors what the kernel does internally to service system calls.
You wouldn't want to have a situation where
syscall(SYS_gettimeofday, ...); /* serviced by kernel */ gettimeofday(...); /* serviced by vDSO */
returns timestamps that aren't monotonically increasing (leaving aside system time adjustments).