diff options
Diffstat (limited to 'sys/kern/sched_ule.c')
-rw-r--r-- | sys/kern/sched_ule.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index f505676..31d3d11 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -76,7 +76,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_switch_func; #include <machine/cpu.h> #include <machine/smp.h> -#if defined(__sparc64__) +#if defined(__powerpc__) && defined(E500) #error "This architecture is not currently compatible with ULE" #endif @@ -839,6 +839,7 @@ sched_balance_pair(struct tdq *high, struct tdq *low) int low_load; int moved; int move; + int cpu; int diff; int i; @@ -860,10 +861,14 @@ sched_balance_pair(struct tdq *high, struct tdq *low) for (i = 0; i < move; i++) moved += tdq_move(high, low); /* - * IPI the target cpu to force it to reschedule with the new - * workload. + * In case the target isn't the current cpu IPI it to force a + * reschedule with the new workload. */ - ipi_cpu(TDQ_ID(low), IPI_PREEMPT); + cpu = TDQ_ID(low); + sched_pin(); + if (cpu != PCPU_GET(cpuid)) + ipi_cpu(cpu, IPI_PREEMPT); + sched_unpin(); } tdq_unlock_pair(high, low); return (moved); |