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)
Thu, Dec 12, 7:22 PM
Unknown Object (File)
Oct 7 2024, 7:55 PM
Unknown Object (File)
Oct 7 2024, 7:55 PM
Unknown Object (File)
Oct 7 2024, 7:55 PM
Unknown Object (File)
Oct 7 2024, 7:33 PM
Unknown Object (File)
Oct 3 2024, 10:00 AM
Unknown Object (File)
Sep 16 2024, 4:45 AM
Unknown Object (File)
Sep 5 2024, 7:07 AM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #65105)

Why did you drop the idle thread check,?

markj added inline comments.
sys/kern/sched_ule.c
2445 ↗(On Diff #65105)

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

2468 ↗(On Diff #65105)

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