From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 6 17:18:16 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 316DB1065672 for ; Mon, 6 Jun 2011 17:18:16 +0000 (UTC) (envelope-from krivenok.dmitry@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7E37E8FC0C for ; Mon, 6 Jun 2011 17:18:15 +0000 (UTC) Received: by bwz12 with SMTP id 12so5304660bwz.13 for ; Mon, 06 Jun 2011 10:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/698JYbNtuStdKh9TLOQgXMVo2ZFU//Cr3xt7gHp2dM=; b=xvH+XS5/gmUomB2CaU9iydLbYckkeN5B2Gbnd9E9khiQJk3FEa5L+/qpSQT517R1Km pQcRPlj3ddBh5eO5La8Xrsfshp2nsESwRbqcyvA+VxjpxakSh8Mm0sUaR4humCnpehZt PRdqGBnXJKs99Cy9c8EqSRKppD2kepKBKHlWo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Le5pY+k/CkELT7obPLuPeo555v28aVUTcWriT/22x2V3ANRy78rSnlwctPfsqWy0Hm 8PQujQd1UneUhYUegQFMA3UYeZQEkTxcL4pvbB4RBy/TWPjm9rlRi6cr88DhjCQsYna5 abZM34c2pJvqCsm0A7+lVmQWumKsQLngo9kME= MIME-Version: 1.0 Received: by 10.204.233.11 with SMTP id jw11mr5134886bkb.32.1307380694319; Mon, 06 Jun 2011 10:18:14 -0700 (PDT) Received: by 10.204.40.3 with HTTP; Mon, 6 Jun 2011 10:18:14 -0700 (PDT) In-Reply-To: <201106021034.16366.jhb@freebsd.org> References: <201106021034.16366.jhb@freebsd.org> Date: Mon, 6 Jun 2011 21:18:14 +0400 Message-ID: From: Dmitry Krivenok To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org 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: Mon, 06 Jun 2011 17:18:16 -0000 I've submitted PR http://www.freebsd.org/cgi/query-pr.cgi?pr=3D157657. Dmitry On Thu, Jun 2, 2011 at 6:34 PM, John Baldwin wrote: > 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 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rtp.prio =3D p4prio_= to_rtpprio(param->sched_priority); >> >> Shouldn't we use p4prio_to_tsprio instead of p4prio_to_rtpprio at the li= ne 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. =A0Can you come up with a test case to show it? > > -- > John Baldwin > --=20 Sincerely yours, Dmitry V. Krivenok e-mail: krivenok.dmitry@gmail.com skype: krivenok_dmitry jabber: krivenok_dmitry@jabber.ru icq: 242-526-443