Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp408245imm; Tue, 7 Aug 2018 22:08:01 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx5y1EA9D2jKXw4ZT0OxC8qIorh+hwaut3dnMZqhpCzE/XE7aJPWFMqIT2BFM0lYHw2Qg6M X-Received: by 2002:a62:5302:: with SMTP id h2-v6mr1266799pfb.183.1533704881849; Tue, 07 Aug 2018 22:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533704881; cv=none; d=google.com; s=arc-20160816; b=eB5T3VTlBeEmKzoCPDKn7xirAa+DwI+5MeV4XzaMV3/abEvfYAPj/DE63uXPEft9h3 tpRo0A3Kf898Iw7l6rV3bAHBs8NXt6Wsqn9CXOfty1ijui4etQHNlqq/lubwI7OVJze0 x4cBYfnC59YNVdyMcmyxe9hQkSq1dBaYFwuv/mdNrCNBGq2pcEeca0mRaqqCYUysoUpV ClhToCvuLvkjw6CHUdT5Z2lm+Pru01WfkinwwInlR3rmwLOyGF/3yhAhqC7fhvEbrYOr zYIArT4UjgYtkYGkTt8LxwZHtAnZ4GVzPYO4VTxSLgu2377q868IjG0GoaEYyuOABqU9 PKCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=AMUvZxAfMI5U5E3xAOLJYBEkIVhuwagxQf6mqyO2yNw=; b=GZXjbVJODu5twKglbVFjT9mIth3udSBceP4+BXjMgVez6kNBqht919ywD2EMiGCbJE tk5hCkHYWKnLAlIYf2f43J7mMR+QkTE/AQbWS4Wt5HtWisbagR6fWZRxjhTqeKTJdroh e1VY0nroWehw8C7MFRDjJ5JQrD/lfmao1IsPWhKFiiIbqqer4GuIHU175UKronoS34MP mLhu+otMLHL87WCiXsxWWGResnqjp3r9Kq7fR6zeeskcB+rpssjVxKgu2a14JPG3+z68 TRre7EvBz6o8YymzoDm8F/dG3Zl9usvccGg12Itq97XaxOHCpBWDt1pqRFildCZ3epMi s/hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nLsTHWV9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15-v6si2612285ply.501.2018.08.07.22.07.47; Tue, 07 Aug 2018 22:08:01 -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=@google.com header.s=20161025 header.b=nLsTHWV9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726991AbeHHHYK (ORCPT + 99 others); Wed, 8 Aug 2018 03:24:10 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:40812 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726733AbeHHHYK (ORCPT ); Wed, 8 Aug 2018 03:24:10 -0400 Received: by mail-yw1-f68.google.com with SMTP id z143-v6so676703ywa.7 for ; Tue, 07 Aug 2018 22:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AMUvZxAfMI5U5E3xAOLJYBEkIVhuwagxQf6mqyO2yNw=; b=nLsTHWV9XuMnZIV4MIUWe74ueLIkkUXEVKJfLQCz/yn/2bTXvWltlz1T6kPHeb6Vok FlsAZskl+uJlAc3J/wMj+3kAQYkXqQh7swAPeho+dDJjt4YRcBsHG/j57aEcgiL9LH9i GjoVTEpyJ1EQGAG3D6uT5d1VLNANLO1GPzBolkSfqjVumJpUdnGVliweQbjrNGGq5Qyg f/YihubP/eLXngRAH0I0sngvIAvzVGyQInnrv89YhsLHmbr3AHecR4jltiu8ipQWLNro JFZDxnaLUwvKMSpH3r3CIewe+YBeA6sFA2FNm0+BYKI1preDzc34zcmlc8dcDkhqJzyA S+QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AMUvZxAfMI5U5E3xAOLJYBEkIVhuwagxQf6mqyO2yNw=; b=FR2CFdTIotpg8XC7eU5e+l4ms3VhdATUewj0J/t4ZMQVEwJ6RR2OpcuM0dVRoyJLFV Nhwi5LWUKGuyl6RGYyLVBELteOJKynx+NufMlLNtqEXrUApCZRpiPKAUGOX49E7ccvR8 U787TNQh32ouRqJIRlZTvIJPAAlUIHGCxFc68bgqY7Q5/a2iGmGuI/i9NS8bFb3rzIKn H/firowGlv1DkdLJFUQSR+vM8RV6BafkUmUVWWcYYaIY7rrdg0J88WbNYkorshNzKNB7 ZGaKuzTPPx18IIJdBH6phrDPkofJdNxgOfFO5mB4Rcg198kRI2McMWwTRj0/drcGOfP0 YrsA== X-Gm-Message-State: AOUpUlFjKyD8oXHArpA0GQUk4xw5roH1+3H3QHE/GEd5gGYo5hcEhZ06 lqYMoS79CFlGXAtKBdcdBPhOtjIw4B5sSI0RGlnW5g== X-Received: by 2002:a0d:c143:: with SMTP id c64-v6mr687995ywd.408.1533704781347; Tue, 07 Aug 2018 22:06:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:bfce:0:0:0:0:0 with HTTP; Tue, 7 Aug 2018 22:06:20 -0700 (PDT) In-Reply-To: References: <20180730222423.196630-1-joel@joelfernandes.org> <20180730222423.196630-4-joel@joelfernandes.org> <20180806155058.5ee875f4@gandalf.local.home> <20180806214300.13e63523@gandalf.local.home> <20180807094954.5137972d@gandalf.local.home> <446AE5F2-39E0-46B6-8E0B-207E003DBF20@google.com> <20180807103410.4fe203cb@gandalf.local.home> <20180807110906.3a1b0ac4@gandalf.local.home> <6B9E5DC9-0859-41B4-9B72-A7D85E9EA2AD@google.com> <20180807194515.4e549c1a@gandalf.local.home> <6D0A3FD6-2190-4CC0-A3C0-7B3759E73243@google.com> <20180807204820.50b83c6d@vmware.local.home> <20180807215522.04114097@vmware.local.home> <20180807222856.3ede96e7@vmware.local.home> From: Joel Fernandes Date: Tue, 7 Aug 2018 22:06:20 -0700 Message-ID: Subject: Re: [PATCH v12 3/3] tracing: Centralize preemptirq tracepoints and unify their usage To: Steven Rostedt Cc: Joel Fernandes , LKML , "Cc: Android Kernel" , Boqun Feng , Byungchul Park , Ingo Molnar , Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Paul McKenney , Peter Zijlstra , Thomas Glexiner , Tom Zanussi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 7, 2018 at 8:53 PM, Joel Fernandes wrote: > On Tue, Aug 7, 2018 at 8:44 PM, Joel Fernandes wrote: >> Hi Steve, >> >> On Tue, Aug 7, 2018 at 7:28 PM, Steven Rostedt wrote: > [...] >>>> @@ -171,8 +174,7 @@ extern void syscall_unregfunc(void); >>>> } while ((++it_func_ptr)->func); \ >>>> } \ >>>> \ >>>> - if (rcuidle) \ >>>> - srcu_read_unlock_notrace(&tracepoint_srcu, idx);\ >>>> + srcu_read_unlock_notrace(ss, idx); \ >>> >>> Hmm, why do we have the two different srcu handles? >> >> Because if the memory operations happening on the normal SRCU handle >> (during srcu_read_lock) is interrupted by NMI, then the other handle >> (devoted to NMI) could be used instead and not bother the interrupted >> handle. Does that makes sense? >> >> When I talked to Paul few months ago about SRCU from NMI context, he >> mentioned the per-cpu memory operations during srcu_read_lock can be >> NMI interrupted, that's why we added that warning. > > So I looked more closely, __srcu_read_lock on 2 different handles may > still be doing a this_cpu_inc on the same location.. > (sp->sda->srcu_lock_count). :-( > > Paul any ideas on how to solve this? > > It does start to seem like a show stopper :-( Steve, another thing we could do is drop "tracepoint: Make rcuidle tracepoint callers use SRCU" and just call into irqsoff and preemptoff tracer hooks directly. The reason I added "tracepoint: Make rcuidle tracepoint callers use SRCU" is because lockdep's performance dropped with existing tracepoint code and SRCU improved that. But now that you're calling directly into lockdep that shouldn't be an issue. That should resolve your NMI issues and keep my macro and other clean ups from the original patch. What do you think? I am out in the morning, but I could write this up in the evening when I get some time (unless you do it before me). thanks, - Joel