Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is __kernel_vsyscall?

Tags:

c++

gdb

I got a core that looks very different from the ones I usually get - most of the threads are in __kernel_vsyscall() :

  9 process 11334  0xffffe410 in __kernel_vsyscall ()
  8 process 11453  0xffffe410 in __kernel_vsyscall ()
  7 process 11454  0xffffe410 in __kernel_vsyscall ()
  6 process 11455  0xffffe410 in __kernel_vsyscall ()
  5 process 11474  0xffffe410 in __kernel_vsyscall ()
  4 process 11475  0xffffe410 in __kernel_vsyscall ()
  3 process 11476  0xffffe410 in __kernel_vsyscall ()
  2 process 11477  0xffffe410 in __kernel_vsyscall ()
  1 process 11323  0x08220782 in MyClass::myfunc ()

What does that mean?

EDIT: In particular, I usually see a lot of threads in "pthread_cond_wait" and "___newselect_nocancel" and now those are on the second frame in each thread - why is this core different?

like image 948
naumcho Avatar asked Dec 05 '08 19:12

naumcho


2 Answers

__kernel_vsyscal is the method used by linux-gate.so (a part of the Linux kernel) to make a system call using the fastest available method, preferably the sysenter instruction. The thing is properly explained by Johan Petersson.

like image 91
coppro Avatar answered Nov 09 '22 00:11

coppro


When you make a system call (like reading from a file, talking to hardware, writing to sockets) you're actually creating an interrupt. The system then handles the interrupt in kernel mode and your call returns with the result. Most of the time it's unusual for you to have a lot of threads in syscall unless you're making blocking calls, in which case it's expected.

More specifically, it means the thread is waiting on a kernel level system call. But that's (unfortunately for my points) already in the name :)

like image 9
Stefan Mai Avatar answered Nov 08 '22 23:11

Stefan Mai