Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752981AbdF3VDR (ORCPT ); Fri, 30 Jun 2017 17:03:17 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:32866 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752772AbdF3VDQ (ORCPT ); Fri, 30 Jun 2017 17:03:16 -0400 MIME-Version: 1.0 In-Reply-To: <20170630085148.4eb252de@gandalf.local.home> References: <20170412053851.26286-1-joelaf@google.com> <20170630085148.4eb252de@gandalf.local.home> From: Joel Fernandes Date: Fri, 30 Jun 2017 14:03:14 -0700 Message-ID: Subject: Re: [RFC] tracing: Add support for critical section event tracing To: Steven Rostedt Cc: LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 954 Lines: 31 Hi Steven, Thanks a lot for the comments, I agree with all of them and had a comment about one of them: On Fri, Jun 30, 2017 at 5:51 AM, Steven Rostedt wrote: [..] > Are you not worried about recursion here? There's no protection. > Wouldn't it be better to have: > > if (!this_cpu_read(tracing_events_cpu)) > return; > > trace_critical_end(ip, parent_ip); > > this_cpu_write(tracing_events_cpu, 0); > > ? > I tried to go over some scenarios and I think it shouldn't be a problem because we start the critical event only when either interrupts are turned off while preemption is turned on, or preempt is turned off while interrupts are turned on, and the fact that we call the tracer while still in the critical section. Let me know if you had a scenario in mind that can cause problems with this. Anyway, I will rearrange the code like you suggested just to be extra safe, Thanks, Joel