Date: Thu, 14 Oct 2004 13:01:04 GMT From: David Schultz <das@FreeBSD.ORG> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/72560: small cleanup of SCHED_ULE Message-ID: <200410141301.i9ED14ia097049@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/72560; it has been noted by GNATS. From: David Schultz <das@FreeBSD.ORG> To: Divacky Roman <xdivac02@stud.fit.vutbr.cz> Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: kern/72560: small cleanup of SCHED_ULE Date: Thu, 14 Oct 2004 08:59:23 -0400 On Tue, Oct 12, 2004, Divacky Roman wrote: > 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 > - 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 there are several CPUs with the same load, this patch would cause the CPU with the lowest index to always be chosen, rather than picking one ``randomly.'' Maybe choosing randomly when all else is equal isn't that important, but this seems to be a step backwards.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410141301.i9ED14ia097049>