Received: by 10.192.165.148 with SMTP id m20csp3666828imm; Mon, 23 Apr 2018 10:14:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/CYfQYxMHhM4XPClzNMsWAc5zmwnQTIc/XVS5c1z9PWppK00Rhvlm19XSB+PGODFcRoxO6 X-Received: by 10.101.88.194 with SMTP id e2mr17731526pgu.229.1524503653860; Mon, 23 Apr 2018 10:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524503653; cv=none; d=google.com; s=arc-20160816; b=jbgGPAQW5tJ1c7AWF8ugcT3ArcDfc2GaE86TWoqROjmjUqx4BI+0AQBEoGzlmqNjwR d9ppqqZoWI17aYT3MMskHD0CoHSvJk4L9djkHXv+s9qnMFoShkKMDBHhjpfLUkm76SAG tAs9qdZqhyvzp/DyNMDXA3BM8yt9Jl0Y06p4DGvHLTRPltPq3PjnCpn1yiNakDkJH/bB nK8APiGJIF4jEngFsAC+nQ7mOR91oJoIGNrQPOgsJyU47l2ZOVok1eIU/mOSNDH9e0Ur LhAJtPiY+AWSBzF4ITp2/mkL5n3exYTK4hliOvFAz8iUmqfVUC3TCCjid2ycV7h52Y/X t/5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:arc-authentication-results; bh=OcJSvEyGGTVHB8SilrKiLtcj02ljbuMU1tKao54wUyU=; b=jFbL9+wXFE7RCkZ2rr3F7gKhp10tIsohslq0PIlJqTnTUMZO2VOWfmkuD0CF1j17Tl NTjsjhBkIWTDh1r9ZEdi9Y9dheUiq01e8ZkTycJYYoAKVnldELE9sJJcq1MT4gkAdoWI cKeDcpgHmDV19mhyi2q7GXSMN4k652oHdSY3RAWfbQaf6Rqj6Nv9uP0DfcKOU6Wg8ZM2 xZU0NZBTpv5w+/Eg7gpnYSWb1yVIA77ah9T1YAOQHYiEc52XXV/wGRSyQzfYVkop+xE+ kTwstW0UnnBiNU5+WmxO8Obz/g5vvDoYIW1AOockih335ldmBebUMyq1A/Kym81RUk0S L75Q== 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 d12si6002193pgq.154.2018.04.23.10.13.58; Mon, 23 Apr 2018 10:14:13 -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 S932107AbeDWRM1 (ORCPT + 99 others); Mon, 23 Apr 2018 13:12:27 -0400 Received: from mail.efficios.com ([167.114.142.138]:49816 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755473AbeDWRMX (ORCPT ); Mon, 23 Apr 2018 13:12:23 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id EAC751B0BC6; Mon, 23 Apr 2018 13:12:22 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail02.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id T4HLspDbd4TR; Mon, 23 Apr 2018 13:12:22 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 0ABEC1B0BBF; Mon, 23 Apr 2018 13:12:22 -0400 (EDT) X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail02.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id gF66PxZ41W9S; Mon, 23 Apr 2018 13:12:21 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id E56C91B0BB2; Mon, 23 Apr 2018 13:12:21 -0400 (EDT) Date: Mon, 23 Apr 2018 13:12:21 -0400 (EDT) From: Mathieu Desnoyers To: rostedt Cc: "Paul E. McKenney" , Joel Fernandes , 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 Message-ID: <1212130312.14753.1524503541789.JavaMail.zimbra@efficios.com> In-Reply-To: <20180423121800.47b173af@gandalf.local.home> 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> Subject: Re: [RFC v4 3/4] irqflags: Avoid unnecessary calls to trace_ if you can MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.138] X-Mailer: Zimbra 8.8.7_GA_1964 (ZimbraWebClient - FF52 (Linux)/8.8.7_GA_1964) Thread-Topic: irqflags: Avoid unnecessary calls to trace_ if you can Thread-Index: 965wGiXknyW8a1ei7m4UbIFl4p0t/w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- 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. Thanks, Mathieu [1] https://github.com/compudj/linux-dev/commits/tracepoint-srcu > > -- Steve -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com