Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1434094imm; Thu, 12 Jul 2018 01:38:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfES7/RLPeMuVWxW9jk9jNw2xSrD86mMuz/LCiltTKHkmgI/pVQmYNAABx8kHvlBNE2CbCU X-Received: by 2002:a17:902:a702:: with SMTP id w2-v6mr1291720plq.41.1531384738357; Thu, 12 Jul 2018 01:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531384738; cv=none; d=google.com; s=arc-20160816; b=Ic3hOJD5hMgFUMv6OiHRVh6QIQiNeSLHyHwFsM9kJnG/AfVZKygq901cr+O7aoqLhB 1cSmxShukJ917w0nsn53g1YuS+4u0e/fUhu8I7+26iTAG2T4CUCv4Z6naX/ZjZJ8bWA4 rZrufrC4SWWRiOTTo5N286OhkyL3Jq7Sn9Qzgy1Oc0jwqS9Ta8fJ70Vq9vD+ALDc90TW 7sOTtToDMeRER9U5E2MAa+dz9DKN8WxNxozvyzxc0PGxmFKf/mr9BoGz0PjdTgMOslIQ IG+jn3KYn+AF/b3z7jNb9E0NvGHr3a3mi4O5LIrUHW/SJyy05xkKDcTkN9ZlbL3OKbmF bQDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=/aQ4xPGLFq29axBAjgTcbyfJ/osLfSZsh8XhETLKro8=; b=C9ZHF9kx/QLyoDLpEAcsvoZjTu6plBt989RfvHIqNF4oyVVsW+GK9cnPpU/WP/L8Sj vx0fgmkrg049k0w4OZWYYo3u3sOWaYL7oOkrdyQPmajw6LOuOtURw3IZ13RTKtDjhmCf JrV1jTET1+m/pUvObzZ8UjUZ4z74UfsmlDcxgTo4BhS30FnguC2POf12IfnDP1TROheI zAI59A3KvDoAOtTWqgTJZ0z/LZO1DpiMlFC5zPn/ae4pfV0RebeE6b70G3BVEq6aMWUC 3yKgktsAmctg5XV52cGTRjG0PobonO09HfNl7OLbeUk/ap1YtLnlD0sq0rhpFk1FX7xY PVbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=hyuNgqxo; 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 x9-v6si20276913plo.368.2018.07.12.01.38.42; Thu, 12 Jul 2018 01:38:58 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=hyuNgqxo; 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 S1726778AbeGLIql (ORCPT + 99 others); Thu, 12 Jul 2018 04:46:41 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36891 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbeGLIql (ORCPT ); Thu, 12 Jul 2018 04:46:41 -0400 Received: by mail-pg1-f195.google.com with SMTP id n15-v6so3700261pgv.4 for ; Thu, 12 Jul 2018 01:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/aQ4xPGLFq29axBAjgTcbyfJ/osLfSZsh8XhETLKro8=; b=hyuNgqxookaOCMXBsd10KOl7SFPmfk4gCyciFvzKC5DhkJmArRHLUNZnOLwrrVdP0d cPb8RlmFx9Jgxmx45EY2/HmGAWW6cDA8od7J7ON9UyHg/z79llnnsP5YFnQo6IULe2fF wVNKWhWNds/9oykEbt3eLF79J2t+JZyaoQBh8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/aQ4xPGLFq29axBAjgTcbyfJ/osLfSZsh8XhETLKro8=; b=pqzHSko/DyI7x8TsandyewlM+sNBzXL3iaCaAVz6bzHh7LV/MR9E/0lgxi/MWKETPg q4QfOjuP4nN3WIyjhXO4jd7P8hLEBSQ8fK6JuIIj0NS8KagF5JjrbmQXLM+xY2DFqS5p EGNUfZuIgwEABDbPrZ1OOvZaB4abLkR7LvPt7gu9E72fUyxiwr8Z/bqckZXHt5xbDtrY WAPx35kAdGvhT7uLdgjz17h3gs9MSSJn8VEUwt9DS7Igh7xtr2hwjkjuEpvs19k5N7zC juodo4c5l9KY6DmEgasaO0C7pEDkIhLzcIzEVis6p0ye8jIUSvfcquxYPKwvkB364Hfz gPug== X-Gm-Message-State: AOUpUlFlv8/8DeYI+16CVegLUIso6JmBzmgcxiBIqnJMBQ7VuIJW7+Rv EJZQie7uYJqXy8H8OKY/lqB/ibSqcCI= X-Received: by 2002:a62:d8c:: with SMTP id 12-v6mr1416320pfn.202.1531384686578; Thu, 12 Jul 2018 01:38:06 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id y27-v6sm6358880pff.181.2018.07.12.01.38.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 01:38:05 -0700 (PDT) Date: Thu, 12 Jul 2018 01:38:05 -0700 From: Joel Fernandes To: Steven Rostedt Cc: Peter Zijlstra , 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 , kernel-team@android.com Subject: Re: [PATCH v9 5/7] tracing: Centralize preemptirq tracepoints and unify their usage Message-ID: <20180712083805.GA67912@joelaf.mtv.corp.google.com> References: <20180628182149.226164-1-joel@joelfernandes.org> <20180628182149.226164-6-joel@joelfernandes.org> <20180711131256.GH2476@hirez.programming.kicks-ass.net> <20180711091944.4d8e78ef@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711091944.4d8e78ef@gandalf.local.home> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 11, 2018 at 09:19:44AM -0400, Steven Rostedt wrote: > > > 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. So actually with or without the clean up, I don't see any issues with dropping lockdep_recursing in my tests at the moment. I'm not sure something else changed between then and now causing the issue to go away. I can include Peter's clean up in my series though if he's Ok with it since you guys agree its a good clean up anyway. Would you prefer I did that, and then also dropped the lockdep_recursing checks? Or should I keep the lockdep_recursing() checks just to be safe? Do you see cases where you want irqsoff tracing while lockdep_recursing() is true? thanks, - Joel