From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:48350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbgKCQO1 (ORCPT ); Tue, 3 Nov 2020 11:14:27 -0500 Date: Tue, 3 Nov 2020 11:14:10 -0500 From: Steven Rostedt Subject: Re: [PATCH 11/11 v2.2] ftrace: Add recording of functions that caused recursion Message-ID: <20201103111410.64feac6c@rorschach.local.home> In-Reply-To: <20201103141043.GO20201@alley> References: <20201030213142.096102821@goodmis.org> <20201030214014.801706340@goodmis.org> <20201102164147.GJ20201@alley> <20201102123721.4fcce2cb@gandalf.local.home> <20201102124606.72bd89c5@gandalf.local.home> <20201102142254.7e148f8a@gandalf.local.home> <20201103141043.GO20201@alley> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-ID: To: Petr Mladek Cc: linux-kernel@vger.kernel.org, Masami Hiramatsu , Andrew Morton , Peter Zijlstra , Ingo Molnar , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Jonathan Corbet , Guo Ren , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck , Joe Lawrence , Kamalesh Babulal , Mauro Carvalho Chehab , Sebastian Andrzej Siewior , linux-doc@vger.kernel.org, linux-csky@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, live-patching@vger.kernel.org On Tue, 3 Nov 2020 15:10:43 +0100 Petr Mladek wrote: > BTW: What is actually the purpose of paranoid_test, please? > > It prevents nested ftrace_record_recursion() calls on the same CPU > (recursion, nesting from IRQ, NMI context). > > Parallel calls from different CPUs are still possible: > > CPU0 CPU1 > if (!atomic_read(¶noid_test)) if (!atomic_read(¶noid_test)) > // passes // passes > atomic_inc(¶noid_test); atomic_inc(¶noid_test); > > > I do not see how a nested call could cause crash while a parallel > one would be OK. > Yeah, I should make that per cpu, but was lazy. ;-) It was added at the end. I'll update that to a per cpu, and local inc operations. -- Steve