From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 12 07:40:23 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6A9616A4CE for ; Tue, 12 Oct 2004 07:40:23 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8522243D53 for ; Tue, 12 Oct 2004 07:40:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9C7eHNr067733 for ; Tue, 12 Oct 2004 07:40:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9C7eHvX067732; Tue, 12 Oct 2004 07:40:17 GMT (envelope-from gnats) Resent-Date: Tue, 12 Oct 2004 07:40:17 GMT Resent-Message-Id: <200410120740.i9C7eHvX067732@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Divacky Roman Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A96816A4CE for ; Tue, 12 Oct 2004 07:33:07 +0000 (GMT) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.10.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id D373E43D39 for ; Tue, 12 Oct 2004 07:33:05 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (8.12.11/8.12.11) with ESMTP id i9C7X2aH071740 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 12 Oct 2004 09:33:02 +0200 (CEST) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.12.11/8.12.5/Submit) id i9C7X1wB071737; Tue, 12 Oct 2004 09:33:01 +0200 (CEST) Message-Id: <200410120733.i9C7X1wB071737@eva.fit.vutbr.cz> Date: Tue, 12 Oct 2004 09:33:01 +0200 (CEST) From: Divacky Roman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/72560: small cleanup of SCHED_ULE X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Divacky Roman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2004 07:40:24 -0000 >Number: 72560 >Category: kern >Synopsis: small cleanup of SCHED_ULE >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Oct 12 07:40:17 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Divacky Roman >Release: FreeBSD 6.0-CURRENT i386 >Organization: home >Environment: FreeBSD witten 6.0-CURRENT FreeBSD 6.0-CURRENT #139: Sat Oct 9 12:37:22 CEST 2004 root@witten:/usr/obj/usr/src/sys/NEOLOGISM i386 >Description: Small cleanup of sched_ule.c, some things are unecessary, some juts ugly. This patch identifies a few and (tries to) repair them. >How-To-Repeat: Apply this >Fix: --- sched_ule.c Wed Oct 6 00:14:02 2004 +++ /root/sched_ule.c Sat Oct 9 14:51:35 2004 @@ -526,14 +526,12 @@ struct kseq_group *low; struct kseq_group *ksg; int cnt; - int i; if (smp_started == 0) goto out; low = high = NULL; - i = random() % (ksg_maxid + 1); for (cnt = 0; cnt <= ksg_maxid; cnt++) { - ksg = KSEQ_GROUP(i); + ksg = KSEQ_GROUP(cnt); /* * Find the CPU with the highest load that has some * threads to transfer. @@ -543,8 +541,6 @@ high = ksg; if (low == NULL || ksg->ksg_load < low->ksg_load) low = ksg; - if (++i > ksg_maxid) - i = 0; } if (low != NULL && high != NULL && high != low) sched_balance_pair(LIST_FIRST(&high->ksg_members), @@ -575,8 +571,7 @@ if (ksg->ksg_transferable == 0) return; - low = NULL; - high = NULL; + low = high = NULL; LIST_FOREACH(kseq, &ksg->ksg_members, ksq_siblings) { load = kseq->ksq_load; if (high == NULL || load > high->ksq_load) @@ -625,7 +624,6 @@ move = min(move, transferable); for (i = 0; i < move; i++) kseq_move(high, KSEQ_ID(low)); - return; } static void >Release-Note: >Audit-Trail: >Unformatted: