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.

38 questions
108
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
  • 14,472
  • 53
  • 157
  • 270
51
votes
2 answers

Where is linux-vdso.so.1 present on the file system

I am learning about VDSO, wrote a simple application which calls gettimeofday() #define _GNU_SOURCE #include #include #include #include #include #include int main(int argc,…
md.jamal
  • 4,067
  • 8
  • 45
  • 108
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,159
  • 3
  • 22
  • 27
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,773
  • 2
  • 13
  • 14
11
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
  • 299
  • 3
  • 12
10
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
  • 6,310
  • 4
  • 30
  • 53
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
  • 313
  • 1
  • 3
  • 13
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
  • 750
  • 1
  • 7
  • 20
4
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
  • 4,210
  • 16
  • 33
4
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
  • 478
  • 1
  • 5
  • 16
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
  • 293
  • 3
  • 11
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
  • 66,139
  • 40
  • 186
  • 319
3
votes
2 answers

Why does strace ignore some syscalls (randomly) depending on environment/kernel?

If I compile the following program: $ cat main.cpp && g++ main.cpp #include int main() { struct timespec ts; return clock_gettime(CLOCK_MONOTONIC, &ts); } and then run it under strace in "standard" Kubuntu, I get this: strace -tt…
DimanNe
  • 1,791
  • 3
  • 12
  • 19
3
votes
0 answers

How to modify vdso variable (vvar)?

Recently I am study vdso in linux. I tried to modify the data in vvar section but it failed. Following is what I've tried. According to lwn described, there're two address for vvar: The first one is a regular kernel-space address whose value is…
Steven
  • 811
  • 4
  • 23
3
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…
戴均維
  • 101
  • 5
1
2 3