Date: Thu, 18 Jan 2018 12:43:57 +0200 From: Andriy Gapon <avg@FreeBSD.org> To: Wojciech Macek <wma@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328110 - head/sys/kern Message-ID: <bdd209e5-70f9-6c13-6c39-67daf03802cf@FreeBSD.org> In-Reply-To: <201801180738.w0I7cswv054484@repo.freebsd.org> References: <201801180738.w0I7cswv054484@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 18/01/2018 09:38, Wojciech Macek wrote: > Author: wma > Date: Thu Jan 18 07:38:54 2018 > New Revision: 328110 > URL: https://svnweb.freebsd.org/changeset/base/328110 > > Log: > KDB: restart only CPUs stopped by KDB > > There is a case when not all CPUs went online. In that situation, > restart only APs which were operational before entering KDB. What is the context here? I mean, what is the state of those CPUs that are not online? Also, it seems you allow for the situation where a CPU that was not online at the time of kdb_trap becomes online (and running) while kdb is active? If that's so, then it can mess up the system big time. I think that this is not a right solution. P.S. While not a recipe for a solution, these musing may be of interest to you: https://lists.freebsd.org/pipermail/freebsd-arch/2011-June/011373.html > Created by: Wojciech Macek <wma@semihalf.com> > Obtained from: Semihalf > Reviewed by: nwhitehorn > Differential revision: https://reviews.freebsd.org/D13949 > Sponsored by: QCM Technologies > > Modified: > head/sys/kern/subr_kdb.c > > Modified: head/sys/kern/subr_kdb.c > ============================================================================== > --- head/sys/kern/subr_kdb.c Thu Jan 18 06:28:21 2018 (r328109) > +++ head/sys/kern/subr_kdb.c Thu Jan 18 07:38:54 2018 (r328110) > @@ -673,6 +673,7 @@ kdb_trap(int type, int code, struct trapframe *tf) > #ifdef SMP > if (!SCHEDULER_STOPPED()) { > other_cpus = all_cpus; > + CPU_NAND(&other_cpus, &stopped_cpus); > CPU_CLR(PCPU_GET(cpuid), &other_cpus); > stop_cpus_hard(other_cpus); > did_stop_cpus = 1; > @@ -707,8 +708,9 @@ kdb_trap(int type, int code, struct trapframe *tf) > kdb_active--; > > #ifdef SMP > + CPU_AND(&other_cpus, &stopped_cpus); > if (did_stop_cpus) > - restart_cpus(stopped_cpus); > + restart_cpus(other_cpus); > #endif > > intr_restore(intr); > -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bdd209e5-70f9-6c13-6c39-67daf03802cf>