svn commit: r328110 - head/sys/kern

Wojciech Macek wma at semihalf.com
Thu Jan 18 14:14:42 UTC 2018


Adding author

wma

2018-01-18 11:43 GMT+01:00 Andriy Gapon <avg at freebsd.org>:

> 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 at 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
>


More information about the svn-src-all mailing list