mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
sched: sched_switch(): Factorize sleepqueue flags
Avoid duplicating common flags for the preempted and non-preempted cases, making it clear that they are the same without resorting to formatting. No functional change. Approved by: markj (mentor) MFC after: 3 days Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
849599e28a
commit
6a3c02bc52
|
@ -1041,9 +1041,8 @@ sched_switch(struct thread *td, int flags)
|
|||
} else {
|
||||
if (TD_IS_RUNNING(td)) {
|
||||
/* Put us back on the run queue. */
|
||||
sched_add(td, preempted ?
|
||||
SRQ_HOLDTD|SRQ_OURSELF|SRQ_YIELDING|SRQ_PREEMPTED :
|
||||
SRQ_HOLDTD|SRQ_OURSELF|SRQ_YIELDING);
|
||||
sched_add(td, SRQ_HOLDTD | SRQ_OURSELF | SRQ_YIELDING |
|
||||
(preempted ? SRQ_PREEMPTED : 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2227,9 +2227,8 @@ sched_switch(struct thread *td, int flags)
|
|||
TD_SET_CAN_RUN(td);
|
||||
} else if (TD_IS_RUNNING(td)) {
|
||||
MPASS(mtx == TDQ_LOCKPTR(tdq));
|
||||
srqflag = preempted ?
|
||||
SRQ_OURSELF|SRQ_YIELDING|SRQ_PREEMPTED :
|
||||
SRQ_OURSELF|SRQ_YIELDING;
|
||||
srqflag = SRQ_OURSELF | SRQ_YIELDING |
|
||||
(preempted ? SRQ_PREEMPTED : 0);
|
||||
#ifdef SMP
|
||||
if (THREAD_CAN_MIGRATE(td) && (!THREAD_CAN_SCHED(td, ts->ts_cpu)
|
||||
|| pickcpu))
|
||||
|
|
Loading…
Reference in a new issue