Received: by 10.192.165.148 with SMTP id m20csp2270708imm; Thu, 26 Apr 2018 08:21:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx49IAnsgVy9fniC3pslGiCkDxm0yn3eCVnT3yllbSIk2iv4PuG4n8J85MQAvkzWfM9pHzfmu X-Received: by 10.101.100.203 with SMTP id t11mr28344274pgv.417.1524756110120; Thu, 26 Apr 2018 08:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524756110; cv=none; d=google.com; s=arc-20160816; b=ygQX4Nk4/Z/twHrIuEEqnZB+fnF1yqt+CS2j+QLbQ6RCTxiUQLNuZmhbJtncihrN9N RkJXFA7oQAy5Uz9Y8kdItIjx3jpota/++Bu8jc3qS9jBgo5EdEUEAInET8he8A/xBPSB 6I72hMbJ8BX+XurfeWYTxjAbmotpCDfD+yHzOqm09Jh66igOKJDk3H6TaWxRR0lmDkHx Mkp/65OQEd5pklG5vxL7JqD5IYuI/kPE+VrDqAuoKnU6zfne7RdWsXBwGWxYVAdacCNV QVaU7bwdh/lPf9SN65uR/N3vgVSgVvUl1IHobnBf3/K/Jmt+hYlCyy7aQMc/O4Agbwll ycFQ== 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=jvw4dkwaAvmJpkxHGwoLm0EaJX8MFTN/5n3PPWQiWOU=; b=BoDFXWgrDFAFWDW9Iz4Y2YibDGcs2nue5VEizu9REUGE0HmxWeo14ns/c8lujYr6Us Pcq3u5VmF8lMv9AMf3W6Rrum1mgGJX/KA3FgMUpcXwzLq7b7BTApeUaVR1rsuNhYN70t 0WaSlpdfrVNn3wXCjZSjgaNuvkJhFjYIeYN1D89Xt6CSFRWyzpJN5v5zDEB+IJhJPMTm juonB6lDbrCpLTuM2GA/wjJ0gxACkQZLToHqBx4uepDqIzYdcy3f0pTFB82Vt1FaKZNw qwcs4GWxTrZE0NVLrP6rbJBrJ5hjlr4Iue2cr5UbqX2MSj8bP7rIJJkIbiAaV5hBKM5v 7QhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gxB34kpR; 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 x7si15717723pgb.300.2018.04.26.08.21.35; Thu, 26 Apr 2018 08:21: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; dkim=pass header.i=@google.com header.s=20161025 header.b=gxB34kpR; 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 S932191AbeDZPUR (ORCPT + 99 others); Thu, 26 Apr 2018 11:20:17 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:37034 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932135AbeDZPUG (ORCPT ); Thu, 26 Apr 2018 11:20:06 -0400 Received: by mail-it0-f44.google.com with SMTP id 71-v6so24256881ith.2 for ; Thu, 26 Apr 2018 08:20:06 -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=jvw4dkwaAvmJpkxHGwoLm0EaJX8MFTN/5n3PPWQiWOU=; b=gxB34kpRz2mgtSIyc3/NkFUpcosTMUb4N6CRTpKE3/gzjEXKpDyd3/ovTVWbbgsTVJ w3SojOZAJpxOECyYQmBbSbjGaE8Rx7tRz0X48+tA8fXWSEa0ZUrl+JbzHx4XwLYxhKTH C3IrtZHpfrtyIH3PNv/hvpKrMSauCsyy8An08mBIo3CQG/8YOb1Q8KaPpHSgOJes+Z0l SjO37iC48SdQ764PrWSg//HukWdDqDv/3HCT0WX8Xjhqfq2MwmBQy6cjTRsPsKvRvDlZ eL6ozKPrL8yszLK1YdyeKR3d/cJKB+cSUzBRZwt+bAb2uWJAGYkzetRAagZZJnzQx5D0 OBNQ== 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=jvw4dkwaAvmJpkxHGwoLm0EaJX8MFTN/5n3PPWQiWOU=; b=E2poiXSi2c63DgfT+S50w14WPD8dzlwAGRe8Swn7oYENg4fZi7gYlmzRpruid7ODrz kOMJEMS2Ig8hzDpp+bUxxMifZ32fk4YtowsrsxK8rEF85tnxNQeyaHOK/Tm0C7uGZGfe WnXVcwZthT43bimlIX6E1iyTrrzpxrgMphFSkM7OzFJAxLjgJFA/H1wN5mh2/+aDR8jE mUYEtRJGxBYHC5ouiJIkygJRMMeIRPPc0eA/+agY+lDLVhI+XMvdXpZFABO+KCULViie duU7snGw+DUAXk7lgIlZ+ADFLuStxygchhHTt9oC0AMt+maf3ECrH/vsTaD7Vx6XJsy+ Q0WQ== X-Gm-Message-State: ALQs6tCL1KWxKoWXHduuNxeNtLtIN8GDdFKfklM4cT0pDHPtUmVQu5Df V02DnnR+ahQyNMSjMRUk0BYQOHLbE1jloDJH4nQeoA== X-Received: by 2002:a24:6d5:: with SMTP id 204-v6mr18683635itv.47.1524756005092; Thu, 26 Apr 2018 08:20:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.181.213 with HTTP; Thu, 26 Apr 2018 08:20:03 -0700 (PDT) In-Reply-To: <2099399401.1995.1524755596613.JavaMail.zimbra@efficios.com> 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> <2099399401.1995.1524755596613.JavaMail.zimbra@efficios.com> From: Joel Fernandes Date: Thu, 26 Apr 2018 08:20:03 -0700 Message-ID: Subject: Re: [RFC v4 3/4] irqflags: Avoid unnecessary calls to trace_ if you can To: Mathieu Desnoyers Cc: "Paul E. McKenney" , rostedt , 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 , "Cc: Android Kernel" 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 Thu, Apr 26, 2018 at 8:13 AM, Mathieu Desnoyers wrote: [...] >>> 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 >> >> Problem is that _blocking isn't the right word either. In my IRQ trace >> point case, it will look something like this then: >> >> local_irq_disable(); >> // IRQs are now off. >> trace_irq_disable_blocking(..); >> >> This wouldn't make sense. What we really want is to use the SRCU >> implementation so that its low overhead... >> >> So it would be something like: >> >> local_irq_disable(); >> // IRQs are now off. >> trace_irq_disable_srcu(..); >> >> I also Ok if, as Paul was saying in his last email, that just for >> _rcuidle, we use SRCU so that we don't have to do the rcu_enter_irq >> stuff. Or we kill the _rcuidle API completely and use _srcu for those >> users instead. We already have 1 implementation specific name anyway >> (rcuidle), we're just replacing it with another one. If in the future, >> if we want to change that name we can always do so (Also if you will, >> correcting the existing already bad naming is a different problem and >> we're not making it any worse tbh). > > Using SRCU rather than the sched-rcu tracepoint synchronization in your > use-case it caused by a limitation of sched-rcu: it cannot be efficiently > used within idle code. So you don't care about the "can_sleep" property > of SRCU. You could event mix SRCU and sched-rcu callsites for the same > probe name, and it would be perfectly valid. > > So even though both "can_sleep" and "rcuidle" caller variants would end > up using SRCU under the hood, each can have its own caller API, e.g.: > > * trace_() -> only non-sleeping probes can register to those. > Uses sched-rcu under the hood. > > * trace__can_sleep() -> both sleeping and non-sleeping probes can > register to those. Uses SRCU under the hood. > > * trace__rcuidle() -> only non-sleeping probes can register to those, > uses SRCU under the hood. > Cool, sounds good to me! For starters I was thinking of changing the _rcuidle underlying implementation as you pointed. This should be simple enough and needs no further additional APIs. I'll work on a patch along these lines and send it out soon. Also would love to work on your sleeping callback case in the future as well incase you wanted to spend your cycles working on other things. thanks, - Joel