From owner-freebsd-stable@FreeBSD.ORG Tue Jan 19 17:13:02 2010 Return-Path: Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 896BF1065698 for ; Tue, 19 Jan 2010 17:13:02 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 11FD68FC15 for ; Tue, 19 Jan 2010 17:13:01 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id o0JHCjco056571; Tue, 19 Jan 2010 18:13:00 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id o0JHCjPj056570; Tue, 19 Jan 2010 18:12:45 +0100 (CET) (envelope-from olli) Date: Tue, 19 Jan 2010 18:12:45 +0100 (CET) Message-Id: <201001191712.o0JHCjPj056570@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, jespasac@minibofh.org In-Reply-To: <4B50737A.4090007@minibofh.org> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 19 Jan 2010 18:13:01 +0100 (CET) Cc: Subject: Re: About nice(1), renice(8) and ULE scheduler X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, jespasac@minibofh.org List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 17:13:02 -0000 Jordi Espasa Clofent 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