From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 2 14:47:11 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E4E5106564A for ; Thu, 2 Jun 2011 14:47:11 +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 57A848FC17 for ; Thu, 2 Jun 2011 14:47:11 +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 0E89A46B38; Thu, 2 Jun 2011 10:47:11 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A0EC28A02B; Thu, 2 Jun 2011 10:47:10 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 2 Jun 2011 10:34:16 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106021034.16366.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 02 Jun 2011 10:47:10 -0400 (EDT) Cc: Dmitry Krivenok Subject: Re: Bug in ksched_setscheduler? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2011 14:47:11 -0000 On Wednesday, June 01, 2011 12:42:42 pm Dmitry Krivenok wrote: > Hello Hackers, > I think I found a bug in ksched_setscheduler() function. > > 209 rtp.prio = p4prio_to_rtpprio(param->sched_priority); > > Shouldn't we use p4prio_to_tsprio instead of p4prio_to_rtpprio at the line 209? > This macro is defined but never used in kernel code: > > $ grep -r 'p4prio_to_tsprio' /usr/src/sys/ > /usr/src/sys/kern/ksched.c:#define p4prio_to_tsprio(P) > ((PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) - (P)) > $ > > Is it a real bug or just my misunderstanding of something? I think it is a real bug. Can you come up with a test case to show it? -- John Baldwin