Received: by 10.192.165.148 with SMTP id m20csp3678523imm; Mon, 23 Apr 2018 10:25:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx485EpmSu/f7keSGlrqWlLGkCc5IOq9d41k4ZDOoSkMzBmAnxDMVkNpMAHYS/DmUHBHM/Edt X-Received: by 2002:a17:902:8e8c:: with SMTP id bg12-v6mr21443838plb.295.1524504335196; Mon, 23 Apr 2018 10:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524504335; cv=none; d=google.com; s=arc-20160816; b=Q7PwazNQMAY+z4rU+oepEQoKNfytYbISDHpYtpe7Ht2CSvh8sgIDjC9afXU7TDpwOO 3wI6PhESA7adAR0YoLGtg4nAP0cUFHe1MdKwkxVe5hmn1J4a0tfcIaenK5nUKDplGfoW 0cYDWAN5ODKkPenh/ZyRK4MCs7O6sGCASIgVXEOu62Ky0txWylLhbdAEFHOaSTHV6Ppk vhJOS7FpF8R7IBKAnOAXbVJBjkIRhphqdNrrtXoA2mmdO8nSRkysme1dBWc9q1nGr0UD CXe3bIc+BURGPMQ1AuMxwO2isiQbkpn24VFSQO2m5rkUIZ1ZEX/ON/Jjc2bPzA2y97XT 84Sg== 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=Sg2dF9WWlHprYAC1HeTDQbnu9rgeYcS+eOqPhSMUXQY=; b=JUTJOQZ4M6ggENwsuscY7QLzoTvkm5sAC7RsX7rNHyW4ncJsFsLeIF+yy0UsKPzeSP 1wjdYLNr+Spb/Pay3754mfyR0RG6egyfFfphI2xWFqxDRjcR12yM4flOqps8L8pWKIz4 tRLiOp8+ft5nw2vH+5ELnjUtvK/cYG8uxUPI00tcsLrqBV72/32HZvj0hY1bDYL6qWWV xI13pKwanJkKMao1ZxQQ9r9ka8e3GjQq6MpXIImIupH2jVWTfxUA9l7HzkF6EcIOd9L5 iVXd5RcXyyVrMza2SXphrC9d0f+T/J/MO5o/u6yDrHRyDBI+JnWPb9CC2LZmNiqQfu35 MhTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=m1i8JbgC; 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 o18si11768033pfa.346.2018.04.23.10.25.20; Mon, 23 Apr 2018 10:25:35 -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=m1i8JbgC; 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 S932151AbeDWRYP (ORCPT + 99 others); Mon, 23 Apr 2018 13:24:15 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:37489 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755286AbeDWRYN (ORCPT ); Mon, 23 Apr 2018 13:24:13 -0400 Received: by mail-io0-f194.google.com with SMTP id y128-v6so19388608iod.4 for ; Mon, 23 Apr 2018 10:24:12 -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=Sg2dF9WWlHprYAC1HeTDQbnu9rgeYcS+eOqPhSMUXQY=; b=m1i8JbgCjVp2G3u0cLgc6zmyLFT1xlYUDGvzaWhuPeL18CnudFciHwsgHwFmE3i4jA A3IV4xaCNgjHzuOWfrbFcjdSO7DKhBsYrS/7SYe40e/2fE07yRNohf090TzojI4t7YaU ORLrvENHpTvjhKbW1ko9w6x7VYlI75r98tUtjcuD/lzYbnLPZumCy7/XpWYdHRfF2GwU WyGtbb2AyS/KLEpyO0mDfuMAPb6o42nZuNZ4WpSOOEe0PqVksgoIsIj5Ivx9mhL0A5Ot iAoVj/ENIIEJue2GkWCqghpsYtqxdg4XLsjbsr4a+1Xxj5Tkz84TSMK9cPtK9EYSGi4D chug== 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=Sg2dF9WWlHprYAC1HeTDQbnu9rgeYcS+eOqPhSMUXQY=; b=hijUSsHRbH+StnLiszJCuQlAOt8MMiptsDchMh9U05UoOfzs2+ocxRl51fVA8E6q5s oo8L62HKrur1NUhTC7yl4U+OOLq4/fP9PbuorC3Ar94STawPXs6ywGcZX7xDsmm7TB2a UO/r3/Gy1Bf0Uf+PzfmqteFRSsfa2xGfU2qjsh5pwAqPKjtFDjnEfucaN0jDf4E+iae5 GGuSpma8MsNkVVup9+SEOlrTSvnPw4i7xEQzEI/NjjRguFbc/yuUGXgsiCN66RJUQWEv Ib9dThpumktNxLi/AtFUqNAujYeZnfpSxcsSInW4GkZfQwS5H3qZdDx+tKM9gAnpKjZF Y7hw== X-Gm-Message-State: ALQs6tAB5GNCrS9z6s64DKqR28AMjHCz2zRa4dJlFCI9gRwqdJZ8eqGI NlKcG4a3KUm8bWI3cNqOYodHYxLI61EE1cPMlXgLLQ== X-Received: by 2002:a6b:2193:: with SMTP id h141-v6mr21416096ioh.235.1524504251926; Mon, 23 Apr 2018 10:24:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.181.213 with HTTP; Mon, 23 Apr 2018 10:24:11 -0700 (PDT) In-Reply-To: <1212130312.14753.1524503541789.JavaMail.zimbra@efficios.com> References: <20180417040748.212236-1-joelaf@google.com> <20180423031926.GF26088@linux.vnet.ibm.com> <409016827.14587.1524493888181.JavaMail.zimbra@efficios.com> <20180423105325.7d5d245b@gandalf.local.home> <1045420715.14686.1524495583859.JavaMail.zimbra@efficios.com> <20180423121800.47b173af@gandalf.local.home> <1212130312.14753.1524503541789.JavaMail.zimbra@efficios.com> From: Joel Fernandes Date: Mon, 23 Apr 2018 10:24:11 -0700 Message-ID: Subject: Re: [RFC v4 3/4] irqflags: Avoid unnecessary calls to trace_ if you can To: Mathieu Desnoyers Cc: rostedt , "Paul E. McKenney" , Namhyung Kim , Masami Hiramatsu , linux-kernel , linux-rt-users , Peter Zijlstra , Ingo Molnar , Tom Zanussi , Thomas Gleixner , Boqun Feng , fweisbec , Randy Dunlap , kbuild test robot , baohong liu , vedang patel , kernel-team 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 Hi Mathieu, On Mon, Apr 23, 2018 at 10:12 AM, Mathieu Desnoyers wrote: > ----- On Apr 23, 2018, at 12:18 PM, rostedt rostedt@goodmis.org wrote: > >> On Mon, 23 Apr 2018 10:59:43 -0400 (EDT) >> Mathieu Desnoyers wrote: >> >>> The main open question here is whether we want one SRCU grace period >>> domain per SRCU tracepoint definition, or just one SRCU domain for all >>> SRCU tracepoints would be fine. >>> >>> I'm not sure what we would gain by having the extra granularity provided >>> by one SRCU grace period domain per tracepoint, and having a single SRCU >>> domain for all SRCU tracepoints makes it easy to batch grace period after >>> bulk tracepoint modifications. >>> >>> Thoughts ? >> >> I didn't think too much depth in this. It was more of just a brain >> storming idea. Yeah, one singe RCU domain may be good enough. I was >> thinking more of how to know when a tracepoint required the SRCU domain >> as supposed to a preempt disabled domain, and wanted to just suggest >> the linker script approach. >> >> This is how I detect if trace_printk() is used anywhere in the kernel >> (and do that big warning if it is). That way the trace events don't >> need to be created any special way. You just use the trace_##event##_X >> flavor and it automatically detects what to do. But we need to make >> sure the same event isn't used for multiple flavors (SRCU vs schedule), >> or maybe we can, and any change would have to do both synchronizations. > > The approach I used for synchronize rcu a few years ago when I did a srcu > tracepoint prototype [1] was simply this: > > static inline void tracepoint_synchronize_unregister(void) > { > + synchronize_srcu(&tracepoint_srcu); > synchronize_sched(); > } > > So whenever we synchronize after tracepoint unregistration, the tracepoint > code always issue both synchronize_sched() and SRCU synchronize. This way, > tracepoint API users don't have to care about the kind of tracepoint they > are updating. > > I'm inclined to explicitly declare the tracepoints with their given > synchronization method. Tracepoint probe callback functions for currently > existing tracepoints expect to have preemption disabled when invoked. > This assumption will not be true anymore for srcu-tracepoints. Nice thing about your patch is it defines at declaration time that its an srcu-tracepoint. The API users don't need care about which synchronization method to use which will probably prevent bugs like, if someone forget to use the _rcuidle variable for a tracepoint or something. I carved out some of my time to test this patch today :-) thanks, - Joel