From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XmVDq-0003li-F6 for kexec@lists.infradead.org; Thu, 06 Nov 2014 22:08:07 +0000 Date: Thu, 6 Nov 2014 17:07:31 -0500 From: Vivek Goyal Subject: Re: [PATCH v8] kernel, add panic_on_warn Message-ID: <20141106220731.GA13590@redhat.com> References: <1415187736-16242-1-git-send-email-prarit@redhat.com> <545B733C.6080903@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: David Rientjes Cc: Prarit Bhargava , Andi Kleen , Jonathan Corbet , jbaron@akamai.com, kexec@lists.infradead.org, Rusty Russell , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Fabian Frederick , isimatu.yasuaki@jp.fujitsu.com, "H. Peter Anvin" , Masami Hiramatsu , Andrew Morton , linux-api@vger.kernel.org On Thu, Nov 06, 2014 at 01:57:36PM -0800, David Rientjes wrote: [..] > You see that doing > > if (panic_on_warn) { > panic_on_warn = 0; > panic(...); > } > > is racy, I hope. If two threads WARN() at the same time, then there's > nothing preventing a double panic() because WARN() itself is not > serialized against anything. So both the current comment and your > suggested revision comment are bogus. panic() is serialized on panic_lock. So I guess it is fine to hit WARN() on multiple cpus. Do you see an issue there? Thanks Vivek _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vivek Goyal Subject: Re: [PATCH v8] kernel, add panic_on_warn Date: Thu, 6 Nov 2014 17:07:31 -0500 Message-ID: <20141106220731.GA13590@redhat.com> References: <1415187736-16242-1-git-send-email-prarit@redhat.com> <545B733C.6080903@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+glkk-kexec=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: David Rientjes Cc: Prarit Bhargava , Andi Kleen , Jonathan Corbet , jbaron-JqFfY2XvxFXQT0dZR+AlfA@public.gmane.org, kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Rusty Russell , linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Fabian Frederick , isimatu.yasuaki-+CUm20s59erQFUHtdCDX3A@public.gmane.org, "H. Peter Anvin" , Masami Hiramatsu , Andrew Morton , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org On Thu, Nov 06, 2014 at 01:57:36PM -0800, David Rientjes wrote: [..] > You see that doing > > if (panic_on_warn) { > panic_on_warn = 0; > panic(...); > } > > is racy, I hope. If two threads WARN() at the same time, then there's > nothing preventing a double panic() because WARN() itself is not > serialized against anything. So both the current comment and your > suggested revision comment are bogus. panic() is serialized on panic_lock. So I guess it is fine to hit WARN() on multiple cpus. Do you see an issue there? Thanks Vivek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751246AbaKFWIS (ORCPT ); Thu, 6 Nov 2014 17:08:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58627 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750963AbaKFWIP (ORCPT ); Thu, 6 Nov 2014 17:08:15 -0500 Date: Thu, 6 Nov 2014 17:07:31 -0500 From: Vivek Goyal To: David Rientjes Cc: Prarit Bhargava , linux-kernel@vger.kernel.org, Jonathan Corbet , Andrew Morton , Rusty Russell , "H. Peter Anvin" , Andi Kleen , Masami Hiramatsu , Fabian Frederick , isimatu.yasuaki@jp.fujitsu.com, jbaron@akamai.com, linux-doc@vger.kernel.org, kexec@lists.infradead.org, linux-api@vger.kernel.org Subject: Re: [PATCH v8] kernel, add panic_on_warn Message-ID: <20141106220731.GA13590@redhat.com> References: <1415187736-16242-1-git-send-email-prarit@redhat.com> <545B733C.6080903@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 06, 2014 at 01:57:36PM -0800, David Rientjes wrote: [..] > You see that doing > > if (panic_on_warn) { > panic_on_warn = 0; > panic(...); > } > > is racy, I hope. If two threads WARN() at the same time, then there's > nothing preventing a double panic() because WARN() itself is not > serialized against anything. So both the current comment and your > suggested revision comment are bogus. panic() is serialized on panic_lock. So I guess it is fine to hit WARN() on multiple cpus. Do you see an issue there? Thanks Vivek