sched_4bsd: use the same switch flags as ULE
ULE uses the more specific SWT_REMOTEPREEMPT and SWT_REMOTEWAKEIDLE switch types, let's do that here as well. SWT_PREEMPT is somewhat redundant when we also have the SW_PREEMPT flag. This only has an effect for kernels built with SCHED_STATS. Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38183
This commit is contained in:
parent
30cd6fd75d
commit
bff02948ed
@ -1542,13 +1542,17 @@ sched_choose(void)
|
|||||||
void
|
void
|
||||||
sched_preempt(struct thread *td)
|
sched_preempt(struct thread *td)
|
||||||
{
|
{
|
||||||
|
int flags;
|
||||||
|
|
||||||
SDT_PROBE2(sched, , , surrender, td, td->td_proc);
|
SDT_PROBE2(sched, , , surrender, td, td->td_proc);
|
||||||
if (td->td_critnest > 1) {
|
if (td->td_critnest > 1) {
|
||||||
td->td_owepreempt = 1;
|
td->td_owepreempt = 1;
|
||||||
} else {
|
} else {
|
||||||
thread_lock(td);
|
thread_lock(td);
|
||||||
mi_switch(SW_INVOL | SW_PREEMPT | SWT_PREEMPT);
|
flags = SW_INVOL | SW_PREEMPT;
|
||||||
|
flags |= TD_IS_IDLETHREAD(td) ? SWT_REMOTEWAKEIDLE :
|
||||||
|
SWT_REMOTEPREEMPT;
|
||||||
|
mi_switch(flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user