Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp712894ybe; Wed, 4 Sep 2019 06:43:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCrvK3Lb4y2yf5tS9g0AkzSIlbYieQw+8w8e7CDKJC0FlEVKbVa9JHWzZvub3t7xfniZ32 X-Received: by 2002:a17:902:6b06:: with SMTP id o6mr40339212plk.33.1567604600285; Wed, 04 Sep 2019 06:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567604600; cv=none; d=google.com; s=arc-20160816; b=JqBMf9hwvtPXcr1CwR3vx9f+yTeaqlG6w9TuY/qSzjMF6adA1fh4Al2nKu5fPtN9BS ekdNwSNleP6w0qd6ouSE0DqfDisvuSzDRdejLdM66y5wuHEDwP3cZdJGLFdXX0ohvwhM 9u3t17N8V3rwK895QhcUfaNxf1lTTN3kQYqPrgvmhNA8x0fEBkK8ZznQbPOPbxrOP+4u P1YlHshMMtmbmCUjVKl96NfqX/Dv3QagpM0XM0KmEzpIJ+BXo7AxxJwvZj4cNvvDVhn+ bfRzkG7HneqiLnU/erbLKH/U5NW4qODZ+qWyW4X3ZzK2EBC3+L7J2OQ4ChSwnAi2pjdC LTpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oklghVAYMBOMwnSSWwCYcajaz+bMy8hr9iKM1Yg7aak=; b=lt7soOW+xN565v/nt7pBmtR/8hKzJv7EZbBhALPmvk0pucJnWpen8SNydnNcAHkAWi s0j4ySZ8lacCH5uWjFgXbTD3CzkgXDRpcXt/LLbtCm29GepJF9y8vKVuj/e6ygVjjXWu cco2I0PDUVZwIkZrsu9PWgdXeVGsouHGTocbdY2CwnJ8AyI1eY+XLCd5AuQFZe4SY070 eyN4Z97oQOU5pPl0eJD9dBor+l7cdn7pze/Hznd1vP75oyOrcPIRiJowyLnruMi9JcJ7 RvWl7CVKUM03g0U3/0rfqEOQpV5ZDXeEjYRdnVN+x5dPPOXeKrbD2M5A+lyDGqL+BkQe +YbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=WBZbEbSl; 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 a13si16798455pgt.217.2019.09.04.06.43.02; Wed, 04 Sep 2019 06:43:20 -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=@joelfernandes.org header.s=google header.b=WBZbEbSl; 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 S1730372AbfIDNmG (ORCPT + 99 others); Wed, 4 Sep 2019 09:42:06 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40190 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbfIDNmF (ORCPT ); Wed, 4 Sep 2019 09:42:05 -0400 Received: by mail-pf1-f194.google.com with SMTP id x127so581830pfb.7 for ; Wed, 04 Sep 2019 06:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oklghVAYMBOMwnSSWwCYcajaz+bMy8hr9iKM1Yg7aak=; b=WBZbEbSlW3hA4LPKkYyJzd58HTqckuyI9ruChkezZC6jGsyEyWalm/XID+in4XwAcX ushgsDXIys/3Uyob2lacjzvMhD6NTYshvx5ow8YlhokuvapX6Z8eLwn5GE56kIpHJBwM zlAbyidngWUPtIg1wV2lD3MndKSRQhmq4kLro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oklghVAYMBOMwnSSWwCYcajaz+bMy8hr9iKM1Yg7aak=; b=sX8wG2q4m94rxYwvD0z+iupDWVfgKR0KUGpfBpFq95s0DQffwW686R/8qIh+S0rnDt XdBJhpdvOxBO4JSqW9o+QzcGtaByoiskC8rY7hqjFmzfOzSAx+zAWKcbAQ2lRvmTbZse FUUj4DtEDIP/0oTImRHsYxIweE/KKQHJ8zwEyobZJ2PyZDOFgOBgAn+ca8IGwimJswYU MANcY8TY4LQBGhiJXQta+p5aUcHEUaJkiNSF6KOMQuZS7ePq9q6vhSnEAq8I+LVdZcaN yKLoNwbHZuWXIcWfz8mqRIvlLqMcQzZ37DI5kItSd2INYVMB9vHk2MKATNnpplxdJYnf kq+A== X-Gm-Message-State: APjAAAVIiglvupr2JbqROVdhDKyodoRBmqjZOaWTcXgE5/FD+Nld5Rwx dQfj3VYajBCzPPMlSBCfA7Qg7A== X-Received: by 2002:a62:4d41:: with SMTP id a62mr46382478pfb.155.1567604524993; Wed, 04 Sep 2019 06:42:04 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id c2sm11187176pfd.66.2019.09.04.06.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 06:42:04 -0700 (PDT) Date: Wed, 4 Sep 2019 09:42:03 -0400 From: Joel Fernandes To: Peter Zijlstra Cc: Viktor Rosendahl , paulmck@kernel.org, Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Subject: Re: [PATCH v5 1/4] ftrace: Implement fs notification for tracing_max_latency Message-ID: <20190904134203.GA240514@google.com> References: <20190903132602.3440-1-viktor.rosendahl@gmail.com> <20190903132602.3440-2-viktor.rosendahl@gmail.com> <20190904040039.GB150430@google.com> <20190904081919.GA2349@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190904081919.GA2349@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 04, 2019 at 10:19:19AM +0200, Peter Zijlstra wrote: > On Wed, Sep 04, 2019 at 12:00:39AM -0400, Joel Fernandes wrote: > > [ Resending since I messed up my last email's headers! ] > > > > On Tue, Sep 03, 2019 at 03:25:59PM +0200, Viktor Rosendahl wrote: > > > This patch implements the feature that the tracing_max_latency file, > > > e.g. /sys/kernel/debug/tracing/tracing_max_latency will receive > > > notifications through the fsnotify framework when a new latency is > > > available. > > > > > > One particularly interesting use of this facility is when enabling > > > threshold tracing, through /sys/kernel/debug/tracing/tracing_thresh, > > > together with the preempt/irqsoff tracers. This makes it possible to > > > implement a user space program that can, with equal probability, > > > obtain traces of latencies that occur immediately after each other in > > > spite of the fact that the preempt/irqsoff tracers operate in overwrite > > > mode. > > > > Adding Paul since RCU faces similar situations, i.e. raising softirq risks > > scheduler deadlock in rcu_read_unlock_special() -- but RCU's solution is to > > avoid raising the softirq and instead use irq_work. > > Which is right. Cool. > > I was wondering, if we can rename __raise_softirq_irqoff() to > > raise_softirq_irqoff_no_wake() and call that from places where there is risk > > of scheduler related deadlocks. Then I think this can be used from Viktor's > > code. Let us discuss - what would happen if the softirq is raised, but > > ksoftirqd is not awakened for this latency notification path? Is this really > > an issue considering the softirq will execute during the next interrupt exit? > > You'd get unbounded latency for processing the softirq and warnings on > going idle with softirqs pending. Thanks for sharing that. > I really don't see why we should/want to be using softirq here. Sure. makes sense. thanks, - Joel