Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: 4.2 scheduler Message-ID: <3058@sun.uucp> Date: Fri, 6-Dec-85 23:52:19 EST Article-I.D.: sun.3058 Posted: Fri Dec 6 23:52:19 1985 Date-Received: Mon, 9-Dec-85 03:36:30 EST References: <1360@wanginst.UUCP> <879@psivax.UUCP> <3043@sun.uucp> <882@psivax.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 33 > >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