Received: by 10.192.165.148 with SMTP id m20csp3528522imm; Mon, 23 Apr 2018 08:03:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx49a5P6f3YWL5aY6MRwPuMVGOH/IMmMq5wRJUGUswKMa0LfZ73S1zPpwJOuhinhGeK7eR19/ X-Received: by 2002:a17:902:9a90:: with SMTP id w16-v6mr21149716plp.390.1524495826469; Mon, 23 Apr 2018 08:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524495826; cv=none; d=google.com; s=arc-20160816; b=H/zfLRjOahfvf1pLbcIocsU71LRnNxMbvoVTFqlpDZGXyY2hUgD4b6jOU+r61otl8j OpgDimivz7lmPOGjsjgq3ZV86Lfu5Yl0oXcpBCA24uL5h6fp2xA5erhA5nPJTSGnZ/Mj wQqNYRLRWicwX4/nK65XqGIeKDz384NVCCkJpRJV9NtkVaJ1dWTpF4KCv7gh4TQRx3Gr OurHjIzYqeaKYFL0PYS20iMqndof+U+vqV94NRqPVRZvssUGdunwo3ZjmWfartIZiDAY fpXOMFI0Mvs08Yptd7vKEInHusvmdxNFEa9YX2Ik0If+b63T735wlrAIIDDWxYB2KzQQ 4UNQ== 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=LLi+P+gjH4BMaVPxoLv7SvSYCbad8rN3gwTLeztEN5o=; b=fgKEFaPxfzO9HXyEypBWsHtSh31vFfJZe0JuMl7I/Mdvg7wrSryMZe9gBs5HCnKG8g FjpQBMo7vY0p+aF0hdxOheDF/olUrzPD9mrPWL8vdyD77UlGY0Jr5YXKbdSd46EQiADc +ytKNFipvZ7t2Qj+4Ccw5frGmkJe+rU1lO+q9s50ydGovL924fXLRpB+GCyaH9ntYoU4 41KLfiCxG2wrGXKP5YFl/a8I41Soz0iPUvIw/NtEPSddiLvtDz3ldu8tYulexWD4JY53 vwXOWa9+s2A8IJ7ybmUf3R6TniiznuEle/2EVW7fVAQWwKbb/aS+iZ9u4lHjfQevqrzl LYVA== 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 b8-v6si11339867ple.556.2018.04.23.08.03.27; Mon, 23 Apr 2018 08:03:46 -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 S1755550AbeDWO7y (ORCPT + 99 others); Mon, 23 Apr 2018 10:59:54 -0400 Received: from mail.efficios.com ([167.114.142.138]:41942 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755198AbeDWO7w (ORCPT ); Mon, 23 Apr 2018 10:59:52 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id EA74A1B4E83; Mon, 23 Apr 2018 10:59:51 -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 t1cxubAn72Jc; Mon, 23 Apr 2018 10:59:44 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 1164F1B4E78; Mon, 23 Apr 2018 10:59:44 -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 YyTmcyC8pKeU; Mon, 23 Apr 2018 10:59:44 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id EC68B1B4E6C; Mon, 23 Apr 2018 10:59:43 -0400 (EDT) Date: Mon, 23 Apr 2018 10:59:43 -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: <1045420715.14686.1524495583859.JavaMail.zimbra@efficios.com> In-Reply-To: <20180423105325.7d5d245b@gandalf.local.home> References: <20180417040748.212236-1-joelaf@google.com> <20180418180250.7b6038dddba46b37c94b796c@kernel.org> <20180419054302.GD13370@sejong> <20180423031926.GF26088@linux.vnet.ibm.com> <409016827.14587.1524493888181.JavaMail.zimbra@efficios.com> <20180423105325.7d5d245b@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: t5nkexqZESs847NstEj1ncWcgzHrBw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Apr 23, 2018, at 10:53 AM, rostedt rostedt@goodmis.org wrote: > On Mon, 23 Apr 2018 10:31:28 -0400 (EDT) > Mathieu Desnoyers wrote: > >> I've been wanting to introduce an alternative tracepoint instrumentation >> "flavor" for e.g. system call entry/exit which rely on SRCU rather than >> sched-rcu (preempt-off). This would allow taking faults within the >> instrumentation >> probe, which makes lots of things easier when fetching data from user-space >> upon system call entry/exit. This could also be used to cleanly instrument >> the idle loop. > > I'd be OK with such an approach. And I don't think it would be that > hard to implement. It could be similar to the rcu_idle() tracepoints, > where each flavor simply passes in what protection it uses for > DO_TRACE(). We could do linker tricks to tell the tracepoint.c code how > the tracepoint is protected (add section code, that could be read to > update flags in the tracepoint). Of course modules that have > tracepoints could only use the standard preempt ones. > > That is, if trace_##event##_srcu(trace_##event##_sp, PARAMS), is used, > then the trace_##event##_sp would need to be created somewhere. The use > of trace_##event##_srcu() would create a section entry, and on boot up > we can see that the use of this tracepoint requires srcu protection > with a pointer to the trace_##event##_sp srcu_struct. This could be > used to make sure that trace_#event() call isn't done multiple times > that uses two different protection flavors. > > I'm just brain storming the idea, and I'm sure I screwed up something > above, but I do believe it is feasible. 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 ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com