sched: Simplify sched_lend_user_prio_cond()
If 'td_lend_user_pri' has the expected value, there is no need to check
the fields that sched_lend_user_prio() modifies, they either are already
good or soon will be ('td->td_lend_user_pri' has just been changed by
a concurrent update).
Reviewed by: kib
Approved by: emaste (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44050
This commit is contained in:
@@ -981,15 +981,9 @@ void
|
||||
sched_lend_user_prio_cond(struct thread *td, u_char prio)
|
||||
{
|
||||
|
||||
if (td->td_lend_user_pri != prio)
|
||||
goto lend;
|
||||
if (td->td_user_pri != min(prio, td->td_base_user_pri))
|
||||
goto lend;
|
||||
if (td->td_priority != td->td_user_pri)
|
||||
goto lend;
|
||||
return;
|
||||
if (td->td_lend_user_pri == prio)
|
||||
return;
|
||||
|
||||
lend:
|
||||
thread_lock(td);
|
||||
sched_lend_user_prio(td, prio);
|
||||
thread_unlock(td);
|
||||
|
||||
@@ -2007,15 +2007,9 @@ void
|
||||
sched_lend_user_prio_cond(struct thread *td, u_char prio)
|
||||
{
|
||||
|
||||
if (td->td_lend_user_pri != prio)
|
||||
goto lend;
|
||||
if (td->td_user_pri != min(prio, td->td_base_user_pri))
|
||||
goto lend;
|
||||
if (td->td_priority != td->td_user_pri)
|
||||
goto lend;
|
||||
return;
|
||||
if (td->td_lend_user_pri == prio)
|
||||
return;
|
||||
|
||||
lend:
|
||||
thread_lock(td);
|
||||
sched_lend_user_prio(td, prio);
|
||||
thread_unlock(td);
|
||||
|
||||
Reference in New Issue
Block a user