Date: Sat, 28 Feb 2004 04:56:30 +0100 From: Erik Trulsson <ertr1013@student.uu.se> To: zhangweiwu@realss.com Cc: questions@freebsd.org Subject: Re: scheduling priority not working? Message-ID: <20040228035629.GA66561@falcon.midgard.homeip.net> In-Reply-To: <Law11-F55YR6CsSTJUj00012ecb@hotmail.com> References: <Law11-F55YR6CsSTJUj00012ecb@hotmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 28, 2004 at 11:37:51AM +0800, Zhang Weiwu wrote: > Hello. I thought scheduling priority is the kind of absolute priority, that > is only when the higher priority process don't ask for resource, can the > lower priority process gets resource. If the higher priority process sucks, > the lower priority process starvs. > > Now I have a old Pentium-mmx 166 box, running mpg321 fine. I wish to listen > to music when recompile the kernel, so turn on the music, do: > #nice make; > I thought "nice make" use the resouce mpg321 left to it, but actually the > music process is seriously disturbed, it begins to sound like .... > terrible. > > So I don't realy understand the scheduling priority mechnism in FreeBSD? No, you dont quite understand the scheduling. There are actually two different priorities that influence scheduling. If you look at the output from top(1) you can see them in the columns labeled 'PRI' and 'NICE'. The first one ('PRI') is the one that is actually used to determine when a process gets to run. This is dynamically adjusted by the system to make sure that all processes get at least *some* CPU-time (so no process can be completely starved.) The second ('NICE') is what is changed by the nice/renice commands and affects how the actual priority is changed by the system. (Processes with a high nice-value essentially gets their priority raised slowly and lowered quickly .) I run at a very similar box, but use mpg123 rather than mpg321, and I can play music without significant disturbance. You might wish to try mpg123 instead, in my experience it needs less CPU-power than mpg321. You could also try using a higher nice value for the make process. (i.e run it with 'nice -19 make' or something like that.) -- <Insert your favourite quote here.> Erik Trulsson ertr1013@student.uu.se
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040228035629.GA66561>