Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jan 2010 18:12:45 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG, jespasac@minibofh.org
Subject:   Re: About nice(1), renice(8) and ULE scheduler
Message-ID:  <201001191712.o0JHCjPj056570@lurza.secnetix.de>
In-Reply-To: <4B50737A.4090007@minibofh.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jordi Espasa Clofent <jespasac@minibofh.org> wrote:
 > I've realized that the nice(1) code hasn't been modified for a long time 
 > (last code change seems from 4 years ago according the sources).
 > 
 > ¿Is the nice(1) behaviour the expected? I mean, ¿Has been the ULE 
 > scheduler adapted to nice(1) command or not?
 > 
 > nice(1) is a very old command based on old concepts and created in times 
 > when SMP didn't exist. So ¿it works correctly when a modern an 
 > re-designed scheduler as ULE is used?

In fact nice is a very simple program.  It only changes the
priority value of a process in a POSIX-compliant way.
There is no need to change or adapt it; it still works fine
in the SMP world and with new schedulers.  It's up to the
scheduler to interpret and handle the priority values of
processes.

In other words:  The nice(1) tool only attaches a number to
a process, nothing more.  Only the scheduler knows what that
number means.  So there's no need to change nice(1).

By the way, the source code of nice(1) is almost trivial.
Basically it just calls the setpriority(2) and execve(2)
syscalls.  99% of the source file consists of the BSD
license test, arguments parsing and C syntax overhead.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"I have stopped reading Stephen King novels.
Now I just read C code instead."
        -- Richard A. O'Keefe



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001191712.o0JHCjPj056570>