Received: by 10.192.165.148 with SMTP id m20csp2248681imm; Thu, 26 Apr 2018 08:04:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+R9xDLFEk7Jfqe1LCXLkzF6fqXtdkv7a1knhKcnDDZf3kjrcnerso2S9zfubbqHJKMX+9+ X-Received: by 10.99.36.7 with SMTP id k7mr27994725pgk.63.1524755090347; Thu, 26 Apr 2018 08:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524755090; cv=none; d=google.com; s=arc-20160816; b=gRqYgPBgPqwePV7iveIBrKQbnn1fBp2+PTdm6ciemZ819Z9r7yTXmH5xClymrlFNxy 1NW7zmlryBD+IIOx2m6aZaVTGEIKcUtAgiuvOR4wrY0Ac721c34twdzCRWXOQtM0njUy cOaqvP55o4XTIGVRN8jeNDGBpkQk+21fNLzYYea0pNm0rNQ4YXqK4eKPirrgZG6+aErU aVpi9Kc9g0S0pvPg89Q5sZSs0TcxCGEwHSre/bX2BDE2bGS0zHj/4C7Rtq1VkQLVEMmb w3pA7O4wEypwIx36rCQoq30nSwksRZ+jVRF+mCG+CM5eqs7Ddvnkjank08RLc23U2z7j 7f9Q== 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=j3AECLD1lsKo+WyuiaqYAMiIWoZhoG5lqlVpfmiSKfg=; b=LzK30AEEtpm8kVJl0aDUqXXmUqkyGHgaWU2vXSONR8buP7RwGBVnrq47zMrZzyDX07 qASXg9AajpSBRfNuZ6fgxgB/4HQUkpVYLIulPVOeXCSLLscRodfkxsb224KvYfLCAIPk s/YCeZ+0LXbOv0cnpu24dRqBwsVtsuOIpGyGD0qTTLBYAeTbENNc5USf+ECmYyR9Z9YZ tmeCmsCun5RBTIJWPNyCzPXUYbX3FczbkLfofTUk2iGc2m2ep4awhhCpPXQ/sSqNQC0f ULZtWxW28+6KNAxcLy/9hFtUmLyME8A1ohdmODeSk3ojSWckMlkGzW7zS8UKyFP6nFTx GCWg== 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 u14-v6si4874291plq.439.2018.04.26.08.04.35; Thu, 26 Apr 2018 08:04:50 -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 S1756597AbeDZPDJ (ORCPT + 99 others); Thu, 26 Apr 2018 11:03:09 -0400 Received: from mail.efficios.com ([167.114.142.138]:37158 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755709AbeDZPDE (ORCPT ); Thu, 26 Apr 2018 11:03:04 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id A80321B7D03; Thu, 26 Apr 2018 11:03:03 -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 EUjzfgEHIUh1; Thu, 26 Apr 2018 11:03:03 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 0A8F21B7CFD; Thu, 26 Apr 2018 11:03:03 -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 XnmqVpJg_R-Y; Thu, 26 Apr 2018 11:03:02 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id E46821B7CF4; Thu, 26 Apr 2018 11:03:02 -0400 (EDT) Date: Thu, 26 Apr 2018 11:03:02 -0400 (EDT) From: Mathieu Desnoyers To: rostedt Cc: Joel Fernandes , "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 Message-ID: <1609895968.1947.1524754982656.JavaMail.zimbra@efficios.com> In-Reply-To: <20180425185149.64f89922@vmware.local.home> References: <20180423172244.694dbc9d@gandalf.local.home> <849066633.939.1524612064698.JavaMail.zimbra@efficios.com> <68e4c123-a223-5e26-e57a-da2515041bf3@google.com> <20180425001049.GX26088@linux.vnet.ibm.com> <20180425042056.GA21412@linux.vnet.ibm.com> <1267842641.1791.1524692456344.JavaMail.zimbra@efficios.com> <20180425185149.64f89922@vmware.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.8_GA_2009 (ZimbraWebClient - FF52 (Linux)/8.8.8_GA_2009) Thread-Topic: irqflags: Avoid unnecessary calls to trace_ if you can Thread-Index: mybaxXBBKgbWEr/xuPnyKoKZZ+t8+w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Apr 25, 2018, at 6:51 PM, rostedt rostedt@goodmis.org wrote: > On Wed, 25 Apr 2018 17:40:56 -0400 (EDT) > Mathieu Desnoyers wrote: > >> One problem with your approach is that you can have multiple callers >> for the same tracepoint name, where some could be non-preemptible and >> others blocking. Also, there is then no clear way for the callback >> registration API to enforce whether the callback expects the tracepoint >> to be blocking or non-preemptible. This can introduce hard to diagnose >> issues in a kernel without debug options enabled. > > I agree that it should not be tied to an implementation name. But > "blocking" is confusing. I would say "can_sleep" or some such name that > states that the trace point caller is indeed something that can sleep. "trace_*event*_{can,might,may}_sleep" are all acceptable candidates for me. > >> >> Regarding the name, I'm OK with having something along the lines of >> trace_*event*_blocking or such. Please don't use "srcu" or other naming >> that is explicitly tied to the underlying mechanism used internally >> however: what we want to convey is that this specific tracepoint probe >> can be preempted and block. The underlying implementation could move to >> a different RCU flavor brand in the future, and it should not impact >> users of the tracepoint APIs. >> >> In order to ensure that probes that may block only register themselves >> to tracepoints that allow blocking, we should introduce new tracepoint >> declaration/definition *and* registration APIs also contain the >> "BLOCKING/blocking" keywords (or such), so we can ensure that a >> tracepoint probe being registered to a "blocking" tracepoint is indeed >> allowed to block. > > I'd really don't want to add more declaration/definitions, as we > already have too many as is, and with different meanings and the number > is of incarnations is n! in growth. > > I'd say we just stick with a trace__can_sleep() call, and make > sure that if that is used that no trace_() call is also used, and > enforce this with linker or compiler tricks. My main concern is not about having both trace__can_sleep() mixed with trace_() calls. It's more about having a registration API allowing modules registering probes that may need to sleep to explicitly declare it, and enforce that tracepoint never connects a probe that may need to sleep with an instrumentation site which cannot sleep. I'm unsure what's the best way to achieve this goal though. We could possibly extend the tracepoint_probe_register_* APIs to introduce e.g. tracepoint_probe_register_prio_flags() and provide a TRACEPOINT_PROBE_CAN_SLEEP as parameter upon registration. If this flag is provided, then we could figure out an way to iterate on all callers, and ensure they are all "can_sleep" type of callers. Thoughts ? Thanks, Mathieu > > -- Steve -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com