Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp656626imm; Wed, 11 Jul 2018 08:46:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/OxLBmWEyElZ8liKDLVbg6B3ukPQEPquO3pQjYxz91pMJTT5gCXXyZnyTxMFR1EgSUEU7 X-Received: by 2002:a63:c20:: with SMTP id b32-v6mr20622775pgl.400.1531324015972; Wed, 11 Jul 2018 08:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531324015; cv=none; d=google.com; s=arc-20160816; b=FWPpqs43W6Mbz8WytHKBrDRl1fvF2cc+0g1aaVmwEYvzmfGdyruP9dMoE8ndZeLJSn rcwz0WTMShZjZf8sD2Wf0HdZQ2HJrfTkFA8tdjm5juQ8w7bFtY23TRzPP9oSb8NWODPw g1cI+l13YsqsEnt6uYWElmCUiZtkv0JgTFoyjs+YEjPvT2l/QVgqHlyFr69trIKtrK1s HDBr72+eyLkom2Z1V7Bs2b/EbGZAFIgvxazb/sPeHDs9PAStzPoU50pNGx4mPRT33iHU umttfmVmUZUMJfmYB0V8Wx88+PYjVh9kL4x3oA0chkgVOIKyJYPmB/ApTdT2eRCiiOac RSJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=HAAp9RprxZP+5NMgDAvU/xzXG/E5KIMsto45AOBroUk=; b=b8HcvQsIgTGG/E2ORVhtj32uPeru4qiJ2totwscoyCn1zQxsRaaocvQE7ldPMQbOtW fpfTlMcG79s/m44zHOesYL3q1iRiU1Wrom+1ZnZyrO49N8y2+WYO4IlREGKi2djG3ig3 EF22E3yvmDCyXWbGw61SyWwUvWsym/LNEFvavmBa7xTFDpR7kBDbr4jJAGcedoQmaCWg LVr0zHhJcqLmIOvihOcRCnoBpXDDyOdw60ZyUdZ0FXJf/18BNs9EyTiCv30E9PopXDsS 3hE1t+A7ZlE8+JRCWlATt65eHKmwVdfv5N4wPG9VXVsXG6uUMN+zeHDnZHzk2SqQqEDe uorA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21-v6si19984699pfk.213.2018.07.11.08.46.39; Wed, 11 Jul 2018 08:46:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732906AbeGKNYG (ORCPT + 99 others); Wed, 11 Jul 2018 09:24:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:48368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732562AbeGKNYF (ORCPT ); Wed, 11 Jul 2018 09:24:05 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 870FB20BF2; Wed, 11 Jul 2018 13:19:45 +0000 (UTC) Date: Wed, 11 Jul 2018 09:19:44 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Joel Fernandes , linux-kernel@vger.kernel.org, Boqun Feng , Byungchul Park , Ingo Molnar , Julia Cartwright , linux-kselftest@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Paul McKenney , Thomas Glexiner , Tom Zanussi Subject: Re: [PATCH v9 5/7] tracing: Centralize preemptirq tracepoints and unify their usage Message-ID: <20180711091944.4d8e78ef@gandalf.local.home> In-Reply-To: <20180711131256.GH2476@hirez.programming.kicks-ass.net> References: <20180628182149.226164-1-joel@joelfernandes.org> <20180628182149.226164-6-joel@joelfernandes.org> <20180711131256.GH2476@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 11 Jul 2018 15:12:56 +0200 Peter Zijlstra wrote: > On Thu, Jun 28, 2018 at 11:21:47AM -0700, Joel Fernandes wrote: > > One note, I have to check for lockdep recursion in the code that calls > > the trace events API and bail out if we're in lockdep recursion > > I'm not seeing any new lockdep_recursion checks... I believe he's talking about this part: +void trace_hardirqs_on(void) +{ + if (lockdep_recursing(current) || !this_cpu_read(tracing_irq_cpu)) + return; + [etc] > > > protection to prevent something like the following case: a spin_lock is > > taken. Then lockdep_acquired is called. That does a raw_local_irq_save > > and then sets lockdep_recursion, and then calls __lockdep_acquired. In > > this function, a call to get_lock_stats happens which calls > > preempt_disable, which calls trace IRQS off somewhere which enters my > > tracepoint code and sets the tracing_irq_cpu flag to prevent recursion. > > This flag is then never cleared causing lockdep paths to never be > > entered and thus causing splats and other bad things. > > Would it not be much easier to avoid that entirely, afaict all > get/put_lock_stats() callers already have IRQs disabled, so that > (traced) preempt fiddling is entirely superfluous. Agreed. Looks like a good clean up. -- Steve