diff options
-rw-r--r-- | sys/kern/kern_switch.c | 4 | ||||
-rw-r--r-- | sys/kern/sched_4bsd.c | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index eeed120..399e3e9 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -502,8 +502,8 @@ maybe_preempt(struct thread *td) * to the new thread. */ ctd = curthread; - if (ctd->td_kse == NULL || ctd->td_kse->ke_thread != ctd) - return (0); + KASSERT ((ctd->td_kse != NULL && ctd->td_kse->ke_thread == ctd), + ("thread has no (or wrong) sched-private part.")); pri = td->td_priority; cpri = ctd->td_priority; if (pri >= cpri || cold /* || dumping */ || TD_IS_INHIBITED(ctd) || diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 62cde32..60b13ce 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -949,9 +949,10 @@ sched_add(struct thread *td, int flags) * the thread is unpinned * or pinned to another cpu, * and there are other available and idle CPUs. - * if we are idle, then skip straight to preemption. + * if we are idle, or it's an interrupt, + * then skip straight to preemption. */ - if ( (! idle) && + if ( (! idle) && ((flags & SRQ_INTR) == 0) && (idle_cpus_mask & ~(hlt_cpus_mask | me)) && ( KSE_CAN_MIGRATE(ke) || ke->ke_runq != &runq_pcpu[PCPU_GET(cpuid)])) { |