doon
doon

Reputation: 2361

Are the CPU cycles used up in doing a context switch accounted for in the process context?

If a process causes a lot of context switches, will the CPU cycles used in the context switch be shown in the process CPU utilization?
In other words, if I run a process that essentially repeatedly executes a system call, then should the output of top show an increase in CPU utilization for the process because of the increase in context switching from user to kernel space and vice versa?

Upvotes: 3

Views: 467

Answers (1)

Ozair Kafray
Ozair Kafray

Reputation: 13549

Yes, I think it should.

Look at the man pages for top and time in linux and possibly other *nix systems.

Upvotes: 1

Related Questions