- Allow the schedulers to IPI_PREEMPT idlethread. This puts the decision

for this behavior on the initiator side.
This commit is contained in:
jeff 2007-01-23 08:38:39 +00:00
parent b12ed0640c
commit f53a7830f7
2 changed files with 12 additions and 18 deletions

View File

@ -949,15 +949,12 @@ ipi_bitmap_handler(struct trapframe frame)
ipi_bitmap = atomic_readandclear_int(&cpu_ipi_pending[cpu]);
if (ipi_bitmap & (1 << IPI_PREEMPT)) {
struct thread *running_thread = curthread;
mtx_lock_spin(&sched_lock);
/* Don't preempt the idle thread */
if (curthread != PCPU_GET(idlethread)) {
struct thread *running_thread = curthread;
if (running_thread->td_critnest > 1)
running_thread->td_owepreempt = 1;
else
mi_switch(SW_INVOL | SW_PREEMPT, NULL);
}
if (running_thread->td_critnest > 1)
running_thread->td_owepreempt = 1;
else
mi_switch(SW_INVOL | SW_PREEMPT, NULL);
mtx_unlock_spin(&sched_lock);
}

View File

@ -1142,24 +1142,21 @@ ipi_bitmap_handler(struct trapframe frame)
ipi_bitmap = atomic_readandclear_int(&cpu_ipi_pending[cpu]);
if (ipi_bitmap & (1 << IPI_PREEMPT)) {
struct thread *running_thread = curthread;
#ifdef COUNT_IPIS
*ipi_preempt_counts[cpu]++;
(*ipi_preempt_counts[cpu])++;
#endif
mtx_lock_spin(&sched_lock);
/* Don't preempt the idle thread */
if (curthread != PCPU_GET(idlethread)) {
struct thread *running_thread = curthread;
if (running_thread->td_critnest > 1)
running_thread->td_owepreempt = 1;
else
mi_switch(SW_INVOL | SW_PREEMPT, NULL);
}
if (running_thread->td_critnest > 1)
running_thread->td_owepreempt = 1;
else
mi_switch(SW_INVOL | SW_PREEMPT, NULL);
mtx_unlock_spin(&sched_lock);
}
if (ipi_bitmap & (1 << IPI_AST)) {
#ifdef COUNT_IPIS
*ipi_ast_counts[cpu]++;
(*ipi_ast_counts[cpu])++;
#endif
/* Nothing to do for AST */
}