kern/72560: small cleanup of SCHED_ULE
David Schultz
das at FreeBSD.ORG
Thu Oct 14 06:01:04 PDT 2004
The following reply was made to PR kern/72560; it has been noted by GNATS.
From: David Schultz <das at FreeBSD.ORG>
To: Divacky Roman <xdivac02 at stud.fit.vutbr.cz>
Cc: FreeBSD-gnats-submit at 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.
More information about the freebsd-bugs
mailing list