Quote:
Originally Posted by
Corona688
You'd be incorrect. System calls don't run inside the process. That's the difference between a system call and a function call... functions are just more code running inside the process, system calls are a message passed to the kernel. The process stops until the kernel starts it again.
It is interesting.
What if I have 50 processes on the host with 100 CPU cores. And let's suggest in some moment of time ALL of them are entering in some CPU expensive syscall. As an example syscall searching data in cache. So, in this moment of time all of them in syscall.
Which state will they have in prstat? I mean exactly column STATE in prstat
---------- Post updated at 11:50 PM ---------- Previous update was at 11:44 PM ----------
Quote:
Originally Posted by
Corona688
Think of it this way. System calls are a process asking something else to do work for it. It doesn't do it itself, it hands it off to the kernel, passes a message. To pass this message, the process is automatically stopped. That's how system calls work.
Yes, I am understanding your point of view. I just trying to understand which state a process has inside syscall and when it became blocked?
My understanding that
- when a process inside syscall on CPU his state in prstat is "CPUn".
- when a process inside syscall waiting response from a disk his state in prstat is "sleeping". And in the same time the process is considered as blocked. In this moment column vmstat.b will be increased.
Is it right?
So, about your point.
All consumed CPU should be recorded for some process(or thread). Let's suggest that we have IDLE system with only one running thread. This thread is entering into CPU consuming syscall. Syscall will consume about 100 hours of CPU.
Which state the thread will have in these 100 hours?
Will CPU time of the thread be increased on 100 hours?