Questions tagged [vdso]

VDSO is a Linux kernel mechanism for exporting some kernel space routines to user space.

VDSO (Virtual Dynamically-linked Shared Object) is a Linux kernel mechanism for exporting certain number of kernel space routines to user space applications, without incurring the performance penalty of the system call interface.

32 questions
94
votes
2 answers

What are vdso and vsyscall?

I did sudo cat /proc/1/maps -vv I am attempting to make sense of the output.I can see a lot of shared libraries being mapped to the memory mapping segment as expected. 7f3c00137000-7f3c00179000 r-xp 00000000 08:01 21233923 …
liv2hak
  • 12,597
  • 41
  • 127
  • 231
13
votes
2 answers

How does the gettimeofday syscall wor‍k?

gettimeofday is a syscall of x86-86 according to this page(just search gettimeofday in the box): int gettimeofday(struct timeval *tv, struct timezone *tz); I thought the disassembly should be easy enough, just prepare the two pointers and call the…
asker
  • 2,101
  • 3
  • 19
  • 26
13
votes
4 answers

High System CPU usage because of system.currentTimeMillis()

I was debugging high System CPU usage (Not user CPU usage) on of our storm supervisors (Wheezy machine). Here are the observations Output of perf for the relevant process: Events: 10K cpu-clock 16.40% java [kernel.kallsyms] [k]…
Rahul Jha
  • 2,083
  • 2
  • 11
  • 13
9
votes
1 answer

Capture vDSO in strace

I was wondering if there is a way to capture (in other words observe) vDSO calls like gettimeofday in strace. Also, is there a way to execute a binary without loading linux-vdso.so.1 (a flag or env variable)? And lastly, what if I write a program…
Anastasios Andronidis
  • 4,661
  • 4
  • 26
  • 44
9
votes
0 answers

debugging info for vsyscall and vdso

I'm using perf tool to profile a kernel module on centos 6.5 (kernel version: 2.6.32-431.el6.x86_64). I've installed the kernel debug info packages separately. While I am able to see the list of [kernel.kallsyms] functions, the symbols related to…
soofyaan
  • 269
  • 2
  • 11
7
votes
1 answer

Linux syscall, libc, VDSO and implementation dissection

I dissects the syscall call in the last libc: git clone git://sourceware.org/git/glibc.git And I have this code in sysdeps/unix/sysv/linux/i386/sysdep.h: # define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ LOADREGS_##nr(args) …
tutuen
  • 163
  • 2
  • 11
5
votes
1 answer

is it possible to turn off vdso on glibc side?

I am aware that passing vdso=0 to kernel can turn this feature off, and that the dynamic linker in glibc can automatic detect and use vdso feature from kernel. Here I met with this problem. There is a RHEL 5.6 box (kernel 2.6.18-238.el5) in my…
heroxbd
  • 703
  • 1
  • 6
  • 18
4
votes
1 answer

Why is vdso appearing during execution of static binaries?

Here is a quick sample program. (This will basically get the procmap associated with the process) > cat sample.c #include int main() { char buffer[1000]; sprintf(buffer, "cat /proc/%d/maps\n", getpid()); int status =…
Sandhya Kumar
  • 283
  • 1
  • 9
4
votes
1 answer

Where do the `[stack]`, `[vdso]` and `[vsyscall]` mmaps come from?

Consider the following program targeting Linux x86_64: inf.s: .global _start .text _start: jmp _start Which is basically an infinite loop. If I link and strip this I get an ELF executable: $ gcc -nostdlib inf.s $ ./a.out & [1]…
Andrew Tomazos
  • 58,923
  • 32
  • 156
  • 267
3
votes
2 answers

Will gettimeofday() be slowed due to the fix to the recently announced Intel bug?

I have been estimating the impact of the recently announced Intel bug on my packet processing application using netmap. So far, I have measured that I process about 50 packets per each poll() system call made, but this figure doesn't include…
juhist
  • 3,795
  • 12
  • 28
3
votes
2 answers

clock_gettime might be very slow even using VDSO

I'm using CentOS Linux release 7.3.1611 on Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz During tests of my userspace application, I have noticed that clock_gettime(CLOCK_MONOTONIC, &ts) may take up to 5-6 microseconds instead of ~23 nanoseconds in…
Konstantin Utkin
  • 468
  • 1
  • 4
  • 15
3
votes
1 answer

gettimeofday() not using vDSO?

I strace'd a java process that was triggering a lot of kernel time to see what syscalls were being used, and was surprised to see that gettimeofday() and clock_gettime() dominated (I suspect it's due to logging), which is strange considering that…
Roee Shenberg
  • 1,217
  • 12
  • 20
2
votes
0 answers

time() not using vdso?

I write a program,use time() function, When I gdb it : [VM_241_149_tlinux ~/test]$ gdb ./testsys_d -q Reading symbols from /data/home/youngxiao/test/testsys_d...(no debugging symbols found)...done. (gdb) b __GI_time Function "__GI_time" not…
youngxiao
  • 21
  • 2
2
votes
0 answers

Why getpid() is not implemented in x86_64's vdso?

After glibc 2.25, glibc's getpid() wrapper no longer cache its result. However, on x86_64 vdso didn't provide getpid() function. Which means everytime getpid() is called, a syscall is triggered. I am wondering why x86_64 vdso does not provide…
戴均維
  • 69
  • 4
2
votes
1 answer

How to get the size of the VDSO on a Linux x86_64 system

I'd like to dump the VDSO to disk in a way that I can verify it is correct with objdump -D. We can get the base address of the VDSO with getauxval(AT_SYSINFO_EHDR) as documented in vdso(7). But how does one get the size of the object? I happen to…
Edd Barrett
  • 2,751
  • 2
  • 23
  • 37
1
2 3