aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_kdb.c
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2011-06-25 10:28:16 +0000
committerAndriy Gapon <avg@FreeBSD.org>2011-06-25 10:28:16 +0000
commit31c5a6e2b8de66a2bdaf69be8c209ae7ec7dc493 (patch)
tree17edf70fb552a400a7cdf5e372418c5fae17e618 /sys/kern/subr_kdb.c
parent1aac6ac94a070ab24ceaf96086475a4d92df8df5 (diff)
downloadsrc-31c5a6e2b8de66a2bdaf69be8c209ae7ec7dc493.tar.gz
src-31c5a6e2b8de66a2bdaf69be8c209ae7ec7dc493.zip
unconditionally stop other cpus when entering kdb in smp system
... and thus retire debug.kdb.stop_cpus tunable/sysctl. The knob was to work around CPU stopping issues, which since have been either fixed or greatly reduced. kdb should really operate in a special environment with scheduler stopped and interrupts disabled to provide deterministic debugging. Discussed with: attilio, rwatson X-MFC after: 2 months or never
Notes
Notes: svn path=/head/; revision=223531
Diffstat (limited to 'sys/kern/subr_kdb.c')
-rw-r--r--sys/kern/subr_kdb.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c
index c2f6e99531d0..2bc5ab230e67 100644
--- a/sys/kern/subr_kdb.c
+++ b/sys/kern/subr_kdb.c
@@ -88,20 +88,6 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_code, CTLTYPE_INT | CTLFLAG_RW, NULL, 0,
kdb_sysctl_trap_code, "I", "set to cause a page fault via code access");
/*
- * Flag indicating whether or not to IPI the other CPUs to stop them on
- * entering the debugger. Sometimes, this will result in a deadlock as
- * stop_cpus() waits for the other cpus to stop, so we allow it to be
- * disabled. In order to maximize the chances of success, use a hard
- * stop for that.
- */
-#ifdef SMP
-static int kdb_stop_cpus = 1;
-SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLFLAG_RW | CTLFLAG_TUN,
- &kdb_stop_cpus, 0, "stop other CPUs when entering the debugger");
-TUNABLE_INT("debug.kdb.stop_cpus", &kdb_stop_cpus);
-#endif
-
-/*
* Flag to indicate to debuggers why the debugger was entered.
*/
const char * volatile kdb_why = KDB_WHY_UNSET;
@@ -515,9 +501,6 @@ kdb_trap(int type, int code, struct trapframe *tf)
{
struct kdb_dbbe *be;
register_t intr;
-#ifdef SMP
- int did_stop_cpus;
-#endif
int handled;
be = kdb_dbbe;
@@ -531,8 +514,7 @@ kdb_trap(int type, int code, struct trapframe *tf)
intr = intr_disable();
#ifdef SMP
- if ((did_stop_cpus = kdb_stop_cpus) != 0)
- stop_cpus_hard(PCPU_GET(other_cpus));
+ stop_cpus_hard(PCPU_GET(other_cpus));
#endif
kdb_active++;
@@ -558,8 +540,7 @@ kdb_trap(int type, int code, struct trapframe *tf)
kdb_active--;
#ifdef SMP
- if (did_stop_cpus)
- restart_cpus(stopped_cpus);
+ restart_cpus(stopped_cpus);
#endif
intr_restore(intr);