summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2007-06-04 23:56:33 +0000
committerjeff <jeff@FreeBSD.org>2007-06-04 23:56:33 +0000
commitb980923789dd5b44ed7f25001a432b29870bd564 (patch)
tree41f98de0bf63b05993f0723618dde401c9490cf1 /sys
parent20e0f793e8b39e029f1d93f5525c9e9bb8ee0563 (diff)
downloadFreeBSD-src-b980923789dd5b44ed7f25001a432b29870bd564.zip
FreeBSD-src-b980923789dd5b44ed7f25001a432b29870bd564.tar.gz
Commit 11/14 of sched_lock decomposition.
- There is no globally visible scheduler lock any longer. For now the watchdog can only check Giant. This model of checking particular locks is flawed and should be revisited. Other metrics should be considered. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/mp_watchdog.c30
-rw-r--r--sys/i386/i386/mp_watchdog.c30
2 files changed, 0 insertions, 60 deletions
diff --git a/sys/amd64/amd64/mp_watchdog.c b/sys/amd64/amd64/mp_watchdog.c
index bc5e6d2..b6ac777 100644
--- a/sys/amd64/amd64/mp_watchdog.c
+++ b/sys/amd64/amd64/mp_watchdog.c
@@ -105,9 +105,7 @@ watchdog_function(void *arg)
* locks to make sure. Then reset the timer.
*/
mtx_lock(&Giant);
- mtx_lock_spin(&sched_lock);
watchdog_timer = WATCHDOG_THRESHOLD;
- mtx_unlock_spin(&sched_lock);
mtx_unlock(&Giant);
callout_reset(&watchdog_callout, 1 * hz, watchdog_function, NULL);
}
@@ -156,34 +154,6 @@ SYSCTL_PROC(_debug, OID_AUTO, watchdog, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
sysctl_watchdog, "I", "");
/*
- * A badly behaved sysctl that leaks the sched lock when written to. Then
- * spin holding it just to make matters worse. This can be used to test the
- * effectiveness of the watchdog by generating a fairly hard and nast hang.
- * Note that Giant is also held in the current world order when we get here.
- */
-static int
-sysctl_leak_schedlock(SYSCTL_HANDLER_ARGS)
-{
- int error, temp;
-
- temp = 0;
- error = sysctl_handle_int(oidp, &temp, 0, req);
- if (error)
- return (error);
-
- if (req->newptr != NULL) {
- if (temp) {
- printf("Leaking the sched lock...\n");
- mtx_lock_spin(&sched_lock);
- while (1);
- }
- }
- return (0);
-}
-SYSCTL_PROC(_debug, OID_AUTO, leak_schedlock, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
- sysctl_leak_schedlock, "IU", "");
-
-/*
* Drop into the debugger by sending an IPI NMI to the boot processor.
*/
static void
diff --git a/sys/i386/i386/mp_watchdog.c b/sys/i386/i386/mp_watchdog.c
index bc5e6d2..b6ac777 100644
--- a/sys/i386/i386/mp_watchdog.c
+++ b/sys/i386/i386/mp_watchdog.c
@@ -105,9 +105,7 @@ watchdog_function(void *arg)
* locks to make sure. Then reset the timer.
*/
mtx_lock(&Giant);
- mtx_lock_spin(&sched_lock);
watchdog_timer = WATCHDOG_THRESHOLD;
- mtx_unlock_spin(&sched_lock);
mtx_unlock(&Giant);
callout_reset(&watchdog_callout, 1 * hz, watchdog_function, NULL);
}
@@ -156,34 +154,6 @@ SYSCTL_PROC(_debug, OID_AUTO, watchdog, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
sysctl_watchdog, "I", "");
/*
- * A badly behaved sysctl that leaks the sched lock when written to. Then
- * spin holding it just to make matters worse. This can be used to test the
- * effectiveness of the watchdog by generating a fairly hard and nast hang.
- * Note that Giant is also held in the current world order when we get here.
- */
-static int
-sysctl_leak_schedlock(SYSCTL_HANDLER_ARGS)
-{
- int error, temp;
-
- temp = 0;
- error = sysctl_handle_int(oidp, &temp, 0, req);
- if (error)
- return (error);
-
- if (req->newptr != NULL) {
- if (temp) {
- printf("Leaking the sched lock...\n");
- mtx_lock_spin(&sched_lock);
- while (1);
- }
- }
- return (0);
-}
-SYSCTL_PROC(_debug, OID_AUTO, leak_schedlock, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
- sysctl_leak_schedlock, "IU", "");
-
-/*
* Drop into the debugger by sending an IPI NMI to the boot processor.
*/
static void
OpenPOWER on IntegriCloud