Page MenuHomeFreeBSD

sched: Flag to force scheduler to always choose idle thread
Changes PlannedPublic

Authored by obiwac on Mon, Dec 29, 8:54 PM.
Tags
None
Referenced Files
F142506523: D54407.id.diff
Tue, Jan 20, 11:44 AM
F142503601: D54407.id.diff
Tue, Jan 20, 11:18 AM
Unknown Object (File)
Thu, Jan 15, 11:52 PM
Unknown Object (File)
Wed, Jan 14, 12:03 PM
Unknown Object (File)
Mon, Jan 12, 11:14 AM
Unknown Object (File)
Thu, Jan 8, 3:31 PM
Unknown Object (File)
Thu, Jan 8, 12:11 AM
Unknown Object (File)
Wed, Jan 7, 12:10 PM
Subscribers

Details

Reviewers
olce
markj
Summary

For s2idle, we need a reliable way to force the scheduler into an idle loop.

This is a bit heavy-handed and not necessarily the right approach - revision opened mostly so @olce can have a look :) Also this would need to be done with the old scheduler if we go ahead with this design.

The small change at line 1502 is because my language server is complaining about it being a misleading statement.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69511
Build 66394: arc lint + arc unit

Event Timeline

obiwac edited the summary of this revision. (Show Details)

I have a couple of comments, but really we should first determine what to do with D54410, please see there.

sys/kern/sched_ule.c
1503–1505

Strange that a language server complains about that... I don't see what is misleading with the original form, except for indentation, where one can argue it doesn't matter here.

The new form is not style(9) compliant, and that I find really misleading :-) (a very quick glance does not see that the if has an else branch).

A way out which is imperfect but that I often use: Put the herald comment inside the block guarded by the if instead of before, possible modify the comment's content due to the new location, and format as prescribed by style(9).

In the end, keeping the original code is probably the best option. If doing some change here, it should anyway be a separate commit.

2666

Seems much simpler to continue not returning anything, and unlock as needed in the function.

2679

See previous inline comment.

2685

See previous inline comment.

2697–2698
2710–2711
2867–2869

I'd move that at the end of tdq_choose() instead of here, even if this function currently has the only call to tdq_choose().