On Sat, 27 Oct 2007, Karel Kulhavy wrote:

> I am raytraing a video with a command "rt" and the "top" is showing this:
> 
> CPU states: 48.4% user, 48.7% nice,  3.0% system,  0.0% interrupt,  0.0% idle
> [...]
> PID USERNAME PRI NICE  SIZE   RES STATE    WAIT     TIME    CPU COMMAND
> 29174 clock     79   10   33M   15M run      -        0:00  4.25% rt
> 
> What is the "nice" state? I know what userspace, system, interrupt handler
> and idle task is, but nice?
> 
> CL<

man 1 nice.
man 1 top.
man 3 sysctl  vide KERN_CPTIME

The nice value is added to the basic priority of a task.  The higher
the "nice", the less likely a task is to get CPU time,  so called
because it is being "nice" to other users.  It's part of an ancient
unix work-around for not having proper prioritized batch queues and
a more versatile scheduler.

The standard joke is that there actually was a user who once
voluntarily ran nice on a time-sharing system.

Top's  48.7% nice here is telling you that the CPU is spending 48.7%
of its time executing tasks that are "niced".  If this includes
processes with negative "nice" values, I do not know; you could
peruse the kernel source or conduct an experiment to discover that,
if you care to.

Dave

Reply via email to