HomeFreeBSD

Fix a ticks comparison in sched_pctcpu_update().

Description

Fix a ticks comparison in sched_pctcpu_update().

We may fail to reset the %CPU tracking window if a thread does not run
for over half of the ticks rollover period, resulting in a bogus %CPU
value for the thread until ticks fully rolls over. Handle this by comparing
the unsigned difference ticks - ts_ltick with SCHED_TICK_TARG instead.

Reviewed by: cem, jeff
MFC after: 1 week
Sponsored by: Dell EMC Isilon

Details

Provenance
markjAuthored on
Reviewer
cem
Parents
rS314624: Reject userland CCBs that have CAM_UNLOCKED set.
Branches
Unknown
Tags
Unknown