scheduling priority not working?

Erik Trulsson ertr1013 at
Fri Feb 27 19:56:34 PST 2004

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 at

More information about the freebsd-questions mailing list