Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!apollo!smv From: smv@apollo.HP.COM (Steve Valentine) Newsgroups: comp.sys.apollo Subject: Re: process priorities (problem?) Message-ID: <504080ad.20b6d@apollo.HP.COM> Date: 9 Mar 91 02:12:00 GMT References: <18030@milton.u.washington.edu> Sender: root@apollo.HP.COM Reply-To: smv@apollo.HP.COM (Steve Valentine) Organization: Hewlett-Packard Apollo Division - Chelmsford, MA Lines: 71 In article <18030@milton.u.washington.edu> etb@milton.u.washington.edu (Eric Bushnell) writes: >Would someone be so kind as to explain how >Domain process priorities work? You're running into one of those areas where Domain/OS maps a square UNIX peg into a round Aegis hole. As you probably already know, UNIX nice values range from -20 to +19. The nice value is fixed for a given process, (i.e. not changed by the OS on its own) and a priority is adjusted, based on the nice value. The scheduler then does fair-share scheduling based on the various priorities of the various processes. A process running CPU bound at nice -20 will get most of the CPU time, but not all of it. In Domain/OS, UNIX nice values are converted into a high and low Aegis priority. The range of Aegis priorities is 1 to 16, and the default range (nice 0) is 3 to 14. The kernel adjusts priority of a process within this range according to how much CPU time it is taking. The upshot of all this is that nice doesn't work the way you think it does. As you move further away from nice 0, one end of the range quickly hits the the absolute limit, 1 or 16, and the other end approches the same limit, that is the range shrinks. For example: (this is close to right, but not guarenteed correct) (Keep in mind here that higher numbers are higher priority in Aegis.) Nice: Aegis Priority range: -20 16-16 -15 11-16 -10 09-16 -5 05-16 -2 03-16 -1 03-15 0 03-14 1 02-14 2 01-14 3 01-13 5 01-12 10 01-08 15 01-04 19 01-01 The kernel preemptivly schedules the process with the highest priority, and splits all the CPU time among the highest priority processes. That is, if you set a process to nice -20, you peg it at priority 16. The kernel will split the CPU time among those processes at priority 16, and give no time to any processes at priority 15 or lower, until all of the processes at priority 16 block. This is a feature of Aegis/Domain/OS, and we're pretty sure that changing it would tick off more people than it would help. We are looking into expanding the range of Aegis priorities so that the nice values can all map to distinct overlapping suburanges of equal size. If this is done, it should appear in sr10.4. #include #include >An ordinary, unprivileged user wasn't happy >with the priority of his batch job, which he >had started with /usr/bin/nohup. So he used >/etc/renice to change his priority to -20, >the highest priority in BSD unix. Only the >superuser can do this, right? Apparently not. It has long been the Apollo position that Domain Nodes are single user machines. We try very hard to make the node as usefull as possible to it's one user. An ordinary, unpriviledged user in this environment may very well have reason to adjust the priority of some process on his or her node, and can only hurt themselves by doing so. When nodes are used in shared environments, their users must learn that it is socially unacceptable to take advantage of some of the features available. If we required root access to renice processes, we would be depriving our users of a feature that they have become accustomed to and which we feel they can benefit from. Steve Valentine - smv@apollo.hp.com Hewlett-Packard Company, Apollo Systems Division, Chelmsford, MA Hermits have no peer pressure. -Steven Wright