Xref: utzoo comp.unix.questions:8587 comp.unix.wizards:10246 Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!netnews.upenn.edu!super.upenn.edu!linc.cis.upenn.edu!david From: david@linc.cis.upenn.edu (David Feldman) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: A question on Unix/Ultrix CPU scheduling Summary: It's very simple Keywords: cpu, scheduling, kernel, nice Message-ID: <5736@super.upenn.edu> Date: 4 Aug 88 03:40:28 GMT References: <2724@bgsuvax.UUCP> Sender: news@super.upenn.edu Reply-To: david@linc.cis.upenn.edu.UUCP (David Feldman) Organization: University of Pennsylvania Lines: 34 > From: nijhawan@bgsuvax.UUCP (Sandeep Nijhawan) > If the Super User were to increase the priority of a process by > using /etc/renice to the maximum possible (-20) and then run a program > with an infinite loop (completely cpu-bound), would any other user > process on the system get the cpu at all until the priority of the super > user's process went below PUSER ? Why? > I modified setpri() in kern_synch.c so that a process with a > certain uid would always be given a priority of (PUSER - 1) irrespective > of its p_cpu value. After I rebuilt the kernel and ran an infinte-loop > process with that uid, I could still run other processes with other uids > though they ran much less frequently. Any ideas about what's going on? > Any help would be much appreciated. Yes, I have Bach. The UNIX philosophy of process switching is that each process gets a maximum of one second (called the quanta) and then the process is switched out. Of the waiting processes that are ready to run, the one with the highest priority will be run next. So, a process that runs at a priority higher than any other process and has no need to wait (e.g. in a disk access or a page fault) will execute in every other process exec slot. My knowledge of this comes from v7m on a PDP-11, but I assume things have not changed too much. Also, process priorities drop over time if they are CPU hoggish, but this may not be the case if the pri is less than PUSER. I have never checked. _ /| Dave Feldman \'o.O' david@dsl.cis.upenn.edu =(___)= Ok, cough! U DSL - land of wonder and enchantment ACK! PHHT! Standard Disclaimer: I am not Bill. I have never been Bill. I don't ever intend to become Bill. I did not create the above representation of Bill. I don't have cash; send me the Bill.