Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp724734ybb; Sat, 28 Mar 2020 08:35:12 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsTze+W3Hc+q14cJgso/Q5y6PrDmUQab3e244vpEz2TBczQ1FAPdp4gGNKIgmgxoNzZXNlW X-Received: by 2002:aca:c209:: with SMTP id s9mr2547227oif.131.1585409711913; Sat, 28 Mar 2020 08:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585409711; cv=none; d=google.com; s=arc-20160816; b=R+Q7lj7bYTaCGLzcXnDCCvmplAkIEL5WYXEjL5OHCeHoWhkeT3u4hw3Yq8IF4+eEDr MKU5TIgSjjyHDfZn0gK9PMUz14ftgrYTIsVamLY1xcKYs3/5lpw4v6N/zIk+LGZrVxmB U1ND2TYZkJRqzAp2mceNlQ+ddGU8KEsZssPnulnwzfQJ1iC1HS1rEWI0UVnqypfOqE4v 1dP/x1HbB3x494Oqal+17tadczKGJXAme6jixt9CnscsjW/a/VK9dmGknirLHtqO96Eh 4Z2S3ZO/D5yy874uSvmd+L/HgqFPS2EBJ6VEh/aUz9bTpoWEekYfNi3g0JKAlZkvJoLO 4qfw== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=jbZmJmA1jZbr6oOaf2UpObiKukIWY6cfSaRTsxlkvjY=; b=kUFEA4Rn9uepm63ml6EMsnvhl+N5xnQ3oQWlezYM1vOEOc1jCe/JnSZ3mcjZifvm3A GpxjmPtrwGPAy7uhCa6oUX5mdYxfmyD6RbiSkJBHAx5Ym+J0LcggP1n0CEWSwLM2sy1M M8mw+s/7DFuflkDxT1sqno2bDie5xYKl9RxRGvPgabn2pYJ914w3R4cFxz7ZJ+lD3oRd LvifYnUNqK2aZG+RihuHnNQznzJq3viAtY0C3GedVhknpxKj+gaMzbv0FGvC9qr2sszl UpoKqqTzGtlPKjtaryliHUEhO1Yt9iZEYY8Wlq9i61XXRFwoTmrLKIjabc+ebH04Xfeq tbUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gf8YTMZr; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si5292695ots.224.2020.03.28.08.34.57; Sat, 28 Mar 2020 08:35:11 -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=@kernel.org header.s=default header.b=Gf8YTMZr; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726937AbgC1Pee (ORCPT + 99 others); Sat, 28 Mar 2020 11:34:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:40214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbgC1Pee (ORCPT ); Sat, 28 Mar 2020 11:34:34 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 276DA20716; Sat, 28 Mar 2020 15:34:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585409673; bh=fULbPKjOq4E91nu36KHICTyk0L3t37HcS6E+MYTYkbE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Gf8YTMZrXX2dXhuLYBTp0EM6GbhACYRF8tkujSja7iWA3za3kgF3tp5U4uWmIoqDF Nu996ShHrubW9w1q7i6BNmXUaexpzq1WWDEfzbHXidoS76GzkT5LwatjcmPqP423CB 3GszUhROM1m76SqM6WIMGIe05i6aossoiFz1IqO8= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id E6C3F35226C6; Sat, 28 Mar 2020 08:34:32 -0700 (PDT) Date: Sat, 28 Mar 2020 08:34:32 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Steven Rostedt , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, Alexei Starovoitov , Andrii Nakryiko Subject: Re: [PATCH RFC v2 tip/core/rcu 14/22] rcu-tasks: Add an RCU Tasks Trace to simplify protection of tracing hooks Message-ID: <20200328153432.GB19865@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200319001024.GA28798@paulmck-ThinkPad-P72> <20200319001100.24917-14-paulmck@kernel.org> <20200319154239.6d67877d@gandalf.local.home> <20200320002813.GL3199@paulmck-ThinkPad-P72> <20200319204838.1f78152a@gandalf.local.home> <20200320024152.GM3199@paulmck-ThinkPad-P72> <20200328140635.GA201808@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200328140635.GA201808@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 28, 2020 at 10:06:35AM -0400, Joel Fernandes wrote: > On Thu, Mar 19, 2020 at 07:41:53PM -0700, Paul E. McKenney wrote: > > On Thu, Mar 19, 2020 at 08:48:38PM -0400, Steven Rostedt wrote: > > > On Thu, 19 Mar 2020 17:28:13 -0700 > > > "Paul E. McKenney" wrote: > > > > > > > Good point. If interrupts are disabled, it will need to use some > > > > other mechanism. One approach is irqwork. Another is a timer. > > > > > > > > Suggestions? > > > > > > Ftrace and perf use irq_work, I would think that should work here too. > > > > Sounds good, will give it a go! And thank you for catching this! > > Since the the Tasks-RCU holdout thread is supposed to wake up periodically to > scan holdout tasks anyway, can it not detect the end of the Trace-RCU grace > period on its next wake up? Sorry if I missed something. It could, and that was how it was structured in the first version. The reason for the timed waits is to be able to print stall warnings. So here is the (abbreviated) sequence of events: o Callbacks appear, waking the kthread. o The kthread moves the callbacks to a private list and starts the grace period. o The kthread scans the tasklist, moving tasks that need further processing to the holdout list. Note that these tasks are holding out from being checked, not necessarily from being in a quiescent state. Note also that tasks that are checked and found to be in a read-side critical section are only added to the holdout list if their state cannot be modified. o The kthreads repeatedly scans the holdout list. Once a task has been successfully checked, it is removed from the holdout list. o When the holdout list is empty, the kthread stops scanning it. o However, the grace period is not necessarily over because some of the previously tasks might still be in their read-side critical sections. So, as noted above, the kthread does timed waits for the count of such tasks to go to zero, printing stall warnings along the way if it takes too long. Or am I missing your point? Thanx, Paul