From owner-freebsd-current@FreeBSD.ORG Thu Nov 17 21:20:59 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 059851065670; Thu, 17 Nov 2011 21:20:59 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id C2D3B8FC14; Thu, 17 Nov 2011 21:20:58 +0000 (UTC) Received: by pzk33 with SMTP id 33so7284778pzk.3 for ; Thu, 17 Nov 2011 13:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dm/EZ93Hbp44JEFUp9XqnBg6J+VitqW6ptBMk7GuSIY=; b=ZywC1OdmBd0DyzjgaIeMPfK0Fw8jKcZaS82kB6oQ5HeH5WTWdPZeCkCWTpcnXeJkyz +ubG8JBduOx+U9w595dgJEW3AsPrraOTGDK/rDpIAY8yuxx+OmzlOMWXa3vHuQqHECqt ZsAj1Rtr3eaXvg2Vm65lQp4F38OER1qL68UoU= MIME-Version: 1.0 Received: by 10.68.38.5 with SMTP id c5mr2361339pbk.93.1321564858103; Thu, 17 Nov 2011 13:20:58 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Thu, 17 Nov 2011 13:20:58 -0800 (PST) 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> <4EC577CD.8020207@FreeBSD.org> Date: Thu, 17 Nov 2011 13:20:58 -0800 X-Google-Sender-Auth: bvrwynSikvHo4oJ44gVWSLE5a9Y Message-ID: From: mdf@FreeBSD.org To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Stop scheduler on panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 21:20:59 -0000 On Thu, Nov 17, 2011 at 1:08 PM, Andriy Gapon 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