Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2011 13:20:58 -0800
From:      mdf@FreeBSD.org
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Stop scheduler on panic
Message-ID:  <CAMBSHm-yRANnJ4dFVoB-xhVVcmVn-3_8CrX3B3_4XVw2sViMiw@mail.gmail.com>
In-Reply-To: <4EC577CD.8020207@FreeBSD.org>
References:  <20111113083215.GV50300@deviant.kiev.zoral.com.ua> <201111171137.18663.jhb@freebsd.org> <4EC53D1B.4000308@FreeBSD.org> <201111171409.37629.jhb@freebsd.org> <4EC563BB.60209@FreeBSD.org> <CAJ-FndB7-UeFVQhqe0sTnpJ2PhWO5ijaCLaE-6bzMU%2B8=gYXeg@mail.gmail.com> <CAMBSHm-jne0qFb5A9ua1N_KOuc8O9e=pjX7_iwMG2dODzpy%2B_A@mail.gmail.com> <4EC577CD.8020207@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 17, 2011 at 1:08 PM, Andriy Gapon <avg@freebsd.org> wrote:
> on 17/11/2011 23:02 mdf@FreeBSD.org said the following:
>> Another patch related to this area we have at $WORK:
>>
>> =A0#if defined(SMP)
>> - =A0 =A0 =A0 /*
>> - =A0 =A0 =A0 =A0* Bind us to CPU 0 so that all shutdown code runs there=
. =A0Some
>> - =A0 =A0 =A0 =A0* systems don't shutdown properly (i.e., ACPI power off=
) if we
>> - =A0 =A0 =A0 =A0* run on another processor.
>> - =A0 =A0 =A0 =A0*/
>> - =A0 =A0 =A0 thread_lock(curthread);
>> - =A0 =A0 =A0 sched_bind(curthread, 0);
>> - =A0 =A0 =A0 thread_unlock(curthread);
>> - =A0 =A0 =A0 KASSERT(PCPU_GET(cpuid) =3D=3D 0, ("%s: not running on cpu=
 0", __func__));
>> + =A0 =A0 =A0 /*
>> + =A0 =A0 =A0 =A0* sched_bind can't be done reliably inside of panic. =
=A0cpu_reset() will
>> + =A0 =A0 =A0 =A0* rebind us in any case, more reliably.
>> + =A0 =A0 =A0 =A0*/
>> + =A0 =A0 =A0 if (panicstr =3D=3D NULL) {
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Bind us to CPU 0 so that all shutdown=
 code runs there. =A0Some
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* systems don't shutdown properly (i.e.=
, ACPI power off) if we
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* run on another processor.
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 thread_lock(curthread);
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 sched_bind(curthread, 0);
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 thread_unlock(curthread);
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 KASSERT(PCPU_GET(cpuid) =3D=3D 0, ("boot: =
not running on cpu 0"));
>> + =A0 =A0 =A0 }
>> =A0#endif
>> =A0 =A0 =A0 =A0 /* We're in the process of rebooting. */
>> =A0 =A0 =A0 =A0 rebooting =3D 1;
>
> Yes, you have contributed this patch before and it is a part of the bigge=
r
> stop-scheduler-on-panic patches. =A0Have you had a chance to review those=
? :)

It's been so long I don't remember what I've sent where.  I did look
over the patch but had no additional comments.

Cheers,
matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMBSHm-yRANnJ4dFVoB-xhVVcmVn-3_8CrX3B3_4XVw2sViMiw>