Page MenuHomeFreeBSD

Handle multiple clock ticks in sched_clock()
ClosedPublic

Authored by jeff on Dec 1 2019, 8:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 15 2024, 4:22 PM
Unknown Object (File)
Dec 22 2023, 11:36 PM
Unknown Object (File)
Nov 10 2023, 3:14 AM
Unknown Object (File)
Nov 10 2023, 1:15 AM
Unknown Object (File)
Nov 8 2023, 5:36 AM
Unknown Object (File)
Oct 9 2023, 1:54 AM
Unknown Object (File)
Oct 9 2023, 12:08 AM
Unknown Object (File)
Sep 22 2023, 7:41 PM
Subscribers

Details

Summary

This was one optimization from https://github.com/freebsd/freebsd/compare/master...jwroberson:schedlock

It is relatively straightforward in ULE to handle a long set of idle ticks without looping. I did not attempt to do so for 4bsd. This also gives an early return for idlethread because it does not need interactivity or priority adjustments. It does run the percent cpu calculator.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27875
Build 26046: arc lint + arc unit

Event Timeline

jeff added reviewers: mav, kib, jhb, markj, mjg.
jeff set the repository for this revision to rS FreeBSD src repository - subversion.
This revision is now accepted and ready to land.Dec 1 2019, 9:07 PM

Looks same to me. The only macro difference is dropping the idle thread check. Is that intended? Is so, is it safe?

sys/kern/sched_ule.c
2468

Why did you drop the idle thread check,?

markj added inline comments.
sys/kern/sched_ule.c
2445

This comment is slightly wrong, we don't update the index once per tick.

2468

It is moved earlier. The change is a no-op since PRI_BASE(td->td_pri_class) != PRI_TIMESHARE for an idle thread.