diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/sched_4bsd.c | 8 | ||||
-rw-r--r-- | sys/kern/sched_ule.c | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index f7025b0d96e8..c96d7b54ba7d 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -940,13 +940,9 @@ sched_switch(struct thread *td, struct thread *newtd, int flags) if ((td->td_flags & TDF_NOLOAD) == 0) sched_load_rem(); - if (newtd) { - MPASS(newtd->td_lock == &sched_lock); - newtd->td_flags |= (td->td_flags & TDF_NEEDRESCHED); - } - td->td_lastcpu = td->td_oncpu; - td->td_flags &= ~TDF_NEEDRESCHED; + if (!(flags & SW_PREEMPT)) + td->td_flags &= ~TDF_NEEDRESCHED; td->td_owepreempt = 0; td->td_oncpu = NOCPU; diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index c1bb98f7cd9e..ac18e778ae28 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1783,7 +1783,8 @@ sched_switch(struct thread *td, struct thread *newtd, int flags) ts->ts_rltick = ticks; td->td_lastcpu = td->td_oncpu; td->td_oncpu = NOCPU; - td->td_flags &= ~TDF_NEEDRESCHED; + if (!(flags & SW_PREEMPT)) + td->td_flags &= ~TDF_NEEDRESCHED; td->td_owepreempt = 0; tdq->tdq_switchcnt++; /* |