Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp404130ybe; Wed, 4 Sep 2019 01:22:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFMXTw3mt2sXQBaPkcI24HP/uR5Bb3HiGD4s92mO8p/Nu4De+hdRSuIZJTjw0cp6NTHsMN X-Received: by 2002:a17:90a:17ab:: with SMTP id q40mr3812010pja.106.1567585346846; Wed, 04 Sep 2019 01:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567585346; cv=none; d=google.com; s=arc-20160816; b=XPXpj5tQEXJJipiKc5c2ezyEHtYC13yq30F6kEl/pMtHsad8QX38/y+Nu4s+juBklD 4ciMMXILURcGTojN8jn3uuYQbTsaihYGWg8a+wKtwYY/UrolmcAHasPKLxcIPj3UQMa9 CXWXI4O91ihaMw6JvhqhMRtHM3jFM5cq38LUtXxB/bti88YfNaUCCeFlB+m616HtH2KS upNyEW1vbKiipb0XtJgruS5/TuTABdVfocqM0iQzXtI1ZYjTKtlclroFTtmOS7BKFrXw L+0ny2iV6darhlwjYgcxy0ApgfbHPycMvr86mXwn/JqqgPOBaEvZrXjgQGKrPNwhpYSd GwEg== 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=ZZNaQ4LXZ7GAaOEQI0TFwLUNueXowwuFXVaKHgUrpds=; b=mqdEYfiX/rYO/TzX+HJsQrv54MYFV+YS6jiqEXmn+8a8mJWbgWputkDPCB2JpPMAHR ORktOUgoAeCeUx//cvkqPQG2Fys73eXG8LsNoc045JQegM7jPRESRsWp3Phr8DUPhzmv IZK49zW3Um1ZTx5YZkGXtOVO69lgCVSjKLM6OH2wy9eTcCR6y3VSDSojgPsM6DHrSL8C 6c3AfvQmzV7P+ir2Ze61fC7qK9F1E5qHAUp+eWM9JbU80Zn5yMCkOQpTauL7aHthOivl 4FzWe/6mw6M+zFAPeLaQcw/u5R6RD9u/znHIYxk4Q11KxxHwAwhyWVNiH+2Je9OmItFf xLXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=JVZzJAjU; 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 l70si16472964pge.446.2019.09.04.01.22.11; Wed, 04 Sep 2019 01:22:26 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=JVZzJAjU; 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 S1729223AbfIDITe (ORCPT + 99 others); Wed, 4 Sep 2019 04:19:34 -0400 Received: from merlin.infradead.org ([205.233.59.134]:60244 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbfIDITe (ORCPT ); Wed, 4 Sep 2019 04:19:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZZNaQ4LXZ7GAaOEQI0TFwLUNueXowwuFXVaKHgUrpds=; b=JVZzJAjUvutqZpA1EnnBt9GSj 1vU07aD4olQmFJMlHFncSfHnFBFUZddMJgyxs5PuIiezj62SySgFxPrjzX4kprKH4tMALw1CpHfuj E0oBNAIlJbjBAfgFq0Pf+jmZD4CBAxzqyuAnft9BaMhVwCRTQYP5YVYT/nEm2jQHo9Dv8SCogafOu LdBM3fHdbJA5YSK/+uYMih9402exK8oHkprbbLoZATYd1CfT286VwSUnr0YqUSm0bigG6qRmIqYlx tgxJC2lLYrMBjBi1G88zbIjti3mWYEG15IYBq0b27IMkjXlrC3NJEktYCU2mxy9smDAGdYtvOJl83 ENZ5pQphA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i5QVd-0002GX-1w; Wed, 04 Sep 2019 08:19:21 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 92453306027; Wed, 4 Sep 2019 10:18:42 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 139E429D882FB; Wed, 4 Sep 2019 10:19:19 +0200 (CEST) Date: Wed, 4 Sep 2019 10:19:19 +0200 From: Peter Zijlstra To: Joel Fernandes 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: <20190904081919.GA2349@hirez.programming.kicks-ass.net> References: <20190903132602.3440-1-viktor.rosendahl@gmail.com> <20190903132602.3440-2-viktor.rosendahl@gmail.com> <20190904040039.GB150430@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190904040039.GB150430@google.com> 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 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. > 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. I really don't see why we should/want to be using softirq here.