diff options
author | peter <peter@FreeBSD.org> | 2004-08-23 21:39:29 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2004-08-23 21:39:29 +0000 |
commit | 326b7f663e843b9660f17260119f638a9a7d2f72 (patch) | |
tree | 89b1af9b2f1d343fd5676d1084f6d765458e27d1 /sys/kern/subr_smp.c | |
parent | 02488a6b3c5b0d35621962fc89ebba434f72ec06 (diff) | |
download | FreeBSD-src-326b7f663e843b9660f17260119f638a9a7d2f72.zip FreeBSD-src-326b7f663e843b9660f17260119f638a9a7d2f72.tar.gz |
Commit Doug White and Alan Cox's fix for the cross-ipi smp deadlock.
We were obtaining different spin mutexes (which disable interrupts after
aquisition) and spin waiting for delivery. For example, KSE processes
do LDT operations which use smp_rendezvous, while other parts of the
system are doing things like tlb shootdowns with a different mutex.
This patch uses the common smp_rendezvous mutex for all MD home-grown
IPIs that spinwait for delivery. Having the single mutex means that
the spinloop to aquire it will enable interrupts periodically, thus
avoiding the cross-ipi deadlock.
Obtained from: dwhite, alc
Reviewed by: jhb
Diffstat (limited to 'sys/kern/subr_smp.c')
-rw-r--r-- | sys/kern/subr_smp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index b1be3fa..945ef6f 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -102,7 +102,14 @@ static void (*smp_rv_action_func)(void *arg); static void (*smp_rv_teardown_func)(void *arg); static void *smp_rv_func_arg; static volatile int smp_rv_waiters[2]; -static struct mtx smp_rv_mtx; + +/* + * Shared mutex to restrict busywaits between smp_rendezvous() and + * smp(_targeted)_tlb_shootdown(). A deadlock occurs if both of these + * functions trigger at once and cause multiple CPUs to busywait with + * interrupts disabled. + */ +struct mtx smp_rv_mtx; /* * Let the MD SMP code initialize mp_maxid very early if it can. |