From owner-freebsd-current@FreeBSD.ORG Thu Nov 17 21:08:33 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 C2277106566B for ; Thu, 17 Nov 2011 21:08:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D9F738FC14 for ; Thu, 17 Nov 2011 21:08:32 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA23859; Thu, 17 Nov 2011 23:08:31 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RR9CA-000C9O-Le; Thu, 17 Nov 2011 23:08:30 +0200 Message-ID: <4EC577CD.8020207@FreeBSD.org> Date: Thu, 17 Nov 2011 23:08:29 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111108 Thunderbird/8.0 MIME-Version: 1.0 To: mdf@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> In-Reply-To: X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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:08:33 -0000 on 17/11/2011 23:02 mdf@FreeBSD.org said the following: > Another patch related to this area we have at $WORK: > > #if defined(SMP) > - /* > - * Bind us to CPU 0 so that all shutdown code runs there. Some > - * systems don't shutdown properly (i.e., ACPI power off) if we > - * run on another processor. > - */ > - thread_lock(curthread); > - sched_bind(curthread, 0); > - thread_unlock(curthread); > - KASSERT(PCPU_GET(cpuid) == 0, ("%s: not running on cpu 0", __func__)); > + /* > + * sched_bind can't be done reliably inside of panic. cpu_reset() will > + * rebind us in any case, more reliably. > + */ > + if (panicstr == NULL) { > + /* > + * Bind us to CPU 0 so that all shutdown code runs there. Some > + * systems don't shutdown properly (i.e., ACPI power off) if we > + * run on another processor. > + */ > + thread_lock(curthread); > + sched_bind(curthread, 0); > + thread_unlock(curthread); > + KASSERT(PCPU_GET(cpuid) == 0, ("boot: not running on cpu 0")); > + } > #endif > /* We're in the process of rebooting. */ > rebooting = 1; Yes, you have contributed this patch before and it is a part of the bigger stop-scheduler-on-panic patches. Have you had a chance to review those? :) -- Andriy Gapon