4.2 scheduler

Guy Harris guy at sun.uucp
Sat Dec 7 14:52:19 AEST 1985


> >Well, it *can* spend that much time in the kernel, depending on what you're
> >doing.  30 to 50% isn't *that* high  ...
> 
> 	Well, I  consider 30% to be reasonable, but I find 50% and up
> to be excessive, after all the machine is really there to execute
> *user* code, not the kernal!

Well, let me ask a couple of questions:

	1) how much work would that user code be able to do if
	   the kernel (that's kernEl, not kernAl, by the way, it's
	   spelled correctly in the passage to which you're referring
	   and it's time programmers learned to spell it correctly)
	   weren't doing opens, reads, writes, etc. for you?

	2) how much of the user code in question is actually
	   doing "support work" for the part of the user code
	   that's doing the real work?

What value was in the mode bit(s) of your processor when a particular piece
of code was executing has little to do with whether that code is performing
useful work.  If you built an OS for your machine which ran all code in
kernel mode (or its equivalent), including "user" programs, your system
would spend 100% of its time in the kernel.  If you built an OS with very
primitive kernel operations, and shoved most "kernel" functions into
userland, it would probably spend the bulk of its time in user mode.
Looking at the percentage of time spent in system vs. user mode might give
you a clue as to what piece of code needs to be sped up
(/{un,vmun,xen,whatever}ix vs. /whatever/your_application) but it's not
necessarily "wrong" to have 50% of your time spent in the kernel - it
depends on what the stuff running on your system is doing.

	Guy Harris



More information about the Comp.unix.wizards mailing list