From owner-svn-src-all@FreeBSD.ORG Thu Feb 24 19:37:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CCD0106566B; Thu, 24 Feb 2011 19:37:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2BAD18FC12; Thu, 24 Feb 2011 19:37:55 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D10DE46B1A; Thu, 24 Feb 2011 14:37:54 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EA4628A009; Thu, 24 Feb 2011 14:37:53 -0500 (EST) From: John Baldwin To: Remko Lodder Date: Thu, 24 Feb 2011 14:35:08 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102241613.p1OGDXpM047076@svn.freebsd.org> <201102241347.39267.jhb@freebsd.org> <5965E5EC-A725-423A-9420-B84AD09993DC@elvandar.org> In-Reply-To: <5965E5EC-A725-423A-9420-B84AD09993DC@elvandar.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102241435.09011.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 24 Feb 2011 14:37:54 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Remko Lodder , src-committers@freebsd.org, davidxu@freebsd.org Subject: Re: svn commit: r219003 - head/usr.bin/nice X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Feb 2011 19:37:55 -0000 On Thursday, February 24, 2011 2:03:33 pm Remko Lodder wrote: > > On Feb 24, 2011, at 7:47 PM, John Baldwin wrote: > > >> > > > > Are you sure that this statement applies to both ULE and 4BSD? The two > > schedulers treat nice values a bit differently. > > No I am not sure that the statement applies, given your response I understand > that both schedulers work differently. Can you or David tell me what the difference > is so that I can properly document it? I thought that the tool is doin the same for all > schedulers, but that the backend might treat it differently. In the case of ULE, ULE decides first if you are interactive or not. If a thread is interactive, nice is completely ignored. For non-interactive threads, ULE computes a priority based on how CPU hoggish the thread is. The nice value is then added to that priority. Thus, a nice value applied to a slightly hoggish process might still end up with a lower priority value (and thus "more" important) than a very hoggish process with a nice value of 0. In 4BSD it is somewhat similar in that when you sleep on a socket ('sbwait') or select, etc. in the kernel, the nice value is effectively ignored. 4BSD relies on the priority values passed to tsleep(), etc. to mark interactive processes whereas ULE uses its own set of heuristics. The effect though is that nice is also ignored for interactive processes under 4BSD and is then added to the resulting 'user priority' (which for 4BSD is always based on how CPU hoggish a process is). I think for 4BSD it might be true that certain nice values will never yield to certain other nice values, but I'm not sure that '0' and '19' are the right numbers there. -- John Baldwin