- Allow the schedulers to IPI_PREEMPT idlethread. This puts the decision
for this behavior on the initiator side.
This commit is contained in:
parent
b12ed0640c
commit
f53a7830f7
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user