From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:47:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52C43106564A; Sun, 15 Jan 2012 22:47:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D8358FC0A; Sun, 15 Jan 2012 22:47:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FMlo6m004316; Sun, 15 Jan 2012 22:47:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FMloZ7004314; Sun, 15 Jan 2012 22:47:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152247.q0FMloZ7004314@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 22:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230178 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:47:50 -0000 Author: avg Date: Sun Jan 15 22:47:49 2012 New Revision: 230178 URL: http://svn.freebsd.org/changeset/base/230178 Log: MFC r228718: ule: ensure that batch timeshare threads are scheduled fairly Second take. Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Sun Jan 15 22:43:34 2012 (r230177) +++ stable/8/sys/kern/sched_ule.c Sun Jan 15 22:47:49 2012 (r230178) @@ -413,7 +413,6 @@ sched_shouldpreempt(int pri, int cpri, i return (0); } -#define TS_RQ_PPQ (((PRI_MAX_BATCH - PRI_MIN_BATCH) + 1) / RQ_NQS) /* * Add a thread to the actual run-queue. Keeps transferable counts up to * date with what is actually on the run-queue. Selects the correct @@ -446,7 +445,8 @@ tdq_runq_add(struct tdq *tdq, struct thr * realtime. Use the whole queue to represent these values. */ if ((flags & (SRQ_BORROWING|SRQ_PREEMPTED)) == 0) { - pri = (pri - PRI_MIN_BATCH) / TS_RQ_PPQ; + pri = RQ_NQS * (pri - PRI_MIN_BATCH) / + (PRI_MAX_BATCH - PRI_MIN_BATCH + 1); pri = (pri + tdq->tdq_idx) % RQ_NQS; /* * This effectively shortens the queue by one so we