Friday, January 15, 2016

linux: gettimeofday - VDSO Virtual Dynamic Shared Object

strace -c date
ciktisinda yaptigim incelemede gettimeofday syscall cagrisinin yapilmadigini gozlemledim sonrasinda yaptigim arastirmada VDSO mimarisi ile bir cozum uygulandigini gordum.

Many application workloads (especially databases and financial service applications) perform extremely frequent gettimeofday or similar time function calls. Optimizing the efficiency of this calls can provide major benefits.
A Virtual Dynamic Shared Object (VDSO), is a shared library that allows application in user space to perform some kernel actions without as much overhead as a system call. The VDSO is often used to provide fast access to the gettimeofday system call data.
Enabling the VDSO instructs the kernel to use its definition of the symbols in the VDSO, rather than the ones found in any user-space shared libraries, particularly the glibc. The effects of enabling the VDSO are system-wide - either all processes use it or none do.
When enabled, the VDSO overrides the glibc definition of gettimeofday with it's own. This removes the overhead of a system call, as the call is made direct to the kernel memory, rather than going through the glibc.

No comments:

Post a Comment