Page MenuHomeFreeBSD

Make the LSFR in sched_ule a function and use it always.
ClosedPublic

Authored by imp on Feb 26 2015, 12:11 AM.
Tags
None
Referenced Files
F106663005: D1968.diff
Fri, Jan 3, 2:10 PM
Unknown Object (File)
Wed, Jan 1, 1:38 AM
Unknown Object (File)
Fri, Dec 13, 8:38 AM
Unknown Object (File)
Nov 27 2024, 4:29 AM
Unknown Object (File)
Nov 20 2024, 10:59 PM
Unknown Object (File)
Oct 10 2024, 8:55 PM
Unknown Object (File)
Oct 7 2024, 4:45 AM
Unknown Object (File)
Oct 7 2024, 4:44 AM

Details

Summary

Create sched_rand() and move the LCG code into that. Call this when
we need randomness in ULE. This removes random() call from the
rebalance interval code.

Submitted by Harrison Grundy

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

imp retitled this revision from to Make the LSFR in sched_ule a function and use it always..
imp updated this object.
imp edited the test plan for this revision. (Show Details)
sys/kern/sched_ule.c
368

Could we use defined constants for the magic values?

This is a LCG not an LSFR, add comments about it.
Also, fix randomness in the rebalancing stuff to be
the full range.

Could we use defined constants for the magic values?

Since they are used only once, I updated sched_random() to include where they
came from. Please let me know if you think this is a good balance. They aren't
really meant to be changed since a good LCG is hard to find.

sys/kern/sched_ule.c
371

I agree with the gang that prefers to avoid such side-effects in the expressions. It is ugly and does not add anything to the code concisenesses.

Since we move the lines around, I do not see a reason to keep the obfuscation in the code. It already caused the bug when Harrison refactored the code.

717

There was stray space added at the beginning of line in the original patch. It seems it was imported there as well.

In D1968#11, @imp wrote:

Nits from kib

I am unable to see any changes WRT original patch.

imp edited edge metadata.

Update with Kib's changes.

No, this time it will really work!

In D1968#13, @kostikbel wrote:
In D1968#11, @imp wrote:

Nits from kib

I am unable to see any changes WRT original patch.

don't know what happened, but they appear to be there now.

kib edited edge metadata.
kib added inline comments.
sys/kern/sched_ule.c
367

Function name should be on the new line.

370

There should be a blank line after local variables declarations.

373

There should be a space before '('.

This revision is now accepted and ready to land.Feb 26 2015, 5:21 PM
imp updated this revision to Diff 4004.

Closed by commit rS279349 (authored by @imp).