From 55b580aea14626bdfa5f22a165b0f1ddf8217cdd Mon Sep 17 00:00:00 2001 From: Alex Hornung Date: Fri, 24 Aug 2012 06:57:43 +0000 Subject: [PATCH] usched_bsd4 - use wakeup_mycpu as appropriate * In the need_user_resched_remote we need to use wakeup_mycpu to avoid sending out IPIs triggering a deep IPI recursion panic. * In the setrunqueue case use wakeup_mycpu as an optimization, since we know that we are on the same CPU as the helper thread we want to wake up. In-discussion-with: Matt Dillon Reported-by: ftigeot --- sys/kern/usched_bsd4.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/usched_bsd4.c b/sys/kern/usched_bsd4.c index 21ffcc4..7a570cb 100644 --- a/sys/kern/usched_bsd4.c +++ b/sys/kern/usched_bsd4.c @@ -896,7 +896,7 @@ found: spin_unlock(&bsd4_spin); if ((dd->upri & ~PPQMASK) > (lp->lwp_priority & ~PPQMASK)) { if (dd->uschedcp == NULL) { - wakeup(&dd->helper_thread); + wakeup_mycpu(&dd->helper_thread); } else { need_user_resched(); } @@ -1582,7 +1582,9 @@ need_user_resched_remote(void *dummy) bsd4_pcpu_t dd = &bsd4_pcpu[gd->gd_cpuid]; need_user_resched(); - wakeup(&dd->helper_thread); + + /* Call wakeup_mycpu to avoid sending IPIs to other CPUs */ + wakeup_mycpu(&dd->helper_thread); } #endif -- 1.7.7.2