Assert that the thread lock is held in sched_pctcpu() instead of
recursively acquiring it. All of the current callers already hold the lock. MFC after: 1 month
This commit is contained in:
parent
a3a11ad455
commit
3da35a0a52
@ -1523,6 +1523,7 @@ sched_pctcpu(struct thread *td)
|
||||
{
|
||||
struct td_sched *ts;
|
||||
|
||||
THREAD_LOCK_ASSERT(td, MA_OWNED);
|
||||
ts = td->td_sched;
|
||||
return (ts->ts_pctcpu);
|
||||
}
|
||||
|
@ -2367,7 +2367,7 @@ sched_pctcpu(struct thread *td)
|
||||
if (ts == NULL)
|
||||
return (0);
|
||||
|
||||
thread_lock(td);
|
||||
THREAD_LOCK_ASSERT(td, MA_OWNED);
|
||||
if (ts->ts_ticks) {
|
||||
int rtick;
|
||||
|
||||
@ -2376,7 +2376,6 @@ sched_pctcpu(struct thread *td)
|
||||
rtick = min(SCHED_TICK_HZ(ts) / SCHED_TICK_SECS, hz);
|
||||
pctcpu = (FSCALE * ((FSCALE * rtick)/hz)) >> FSHIFT;
|
||||
}
|
||||
thread_unlock(td);
|
||||
|
||||
return (pctcpu);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user