Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1784370ybh; Sun, 15 Mar 2020 10:59:56 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuNKESpXHQukBUT4UYjI+pBO1VzX/7I+p5O7Qr/slpS1vUaLbHfnLn+ZyctOQHMJwfcIjSU X-Received: by 2002:a9d:5d09:: with SMTP id b9mr19407250oti.207.1584295196430; Sun, 15 Mar 2020 10:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584295196; cv=none; d=google.com; s=arc-20160816; b=nVm4vayH7+lCdF1AZD+i43GEJtU7u5AJPFI6lz4ZrrcQLv4Z6sqgkQeETLbu+2AReS ysPWG7OSBdwXZ3W90AgtuynnIPVvk82pGy71PNAUkzU6f1Z3yINovoaiOAxAYGLFVdbv flXsp0M6UKwCGwccsCvEyuVLxxsvOT/XMAy2lDXG/os1BtBGJw4A1ewSRE7wQeHjM9qV BB07haFVx+W+++vAUvMmMRq3PqScLYUNHhh+sM8aH/V2vargMKrOaNt4sQA110PGnS8o dh4smJjsN6PKmq3+yddQCzYS+g28PQwllF7mGV56hL4T82hMHr+JgbNeKMKgJcw0sC7S Ln9w== 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=F9CeeIjsJD6sfXA97FCLGtgJ+0JJqV+93kX7pLChzfA=; b=DCaz7l2rT16fWTU67B7qwy14B6d95n0wDhRQQ7z1TV8+zalyonXQLTNQn5s/KawLXl tKAac/RXcsq3A9SPHsAn5D115m/acqq5HAQY9j75hhyqg+Hoqv7f/My6WAv7RH+5D5K3 k9FIgtS+QhNX7qk+aqyjP6dVb4g+sw3eHkOctYDDtgH53zwcgUw/VJhV5f1idsgzPfGq RDpF5cyVteIdxEJC8vIF59l3WiSwggFvDorwL/YmaD/QZj4njYMhAIwpO3XwGDKrnwaK ZH5J4pQneU/mii3x1lVNpa+a/FVL6qdsS6yebCT0HCUQsNuRqqgMvcIf5ugs5EDp3UjR EGOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GopWpZgP; 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 x66si6548653ota.244.2020.03.15.10.59.43; Sun, 15 Mar 2020 10:59:56 -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=GopWpZgP; 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 S1729016AbgCOR7X (ORCPT + 99 others); Sun, 15 Mar 2020 13:59:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:48824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729001AbgCOR7W (ORCPT ); Sun, 15 Mar 2020 13:59:22 -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 D4A8B20658; Sun, 15 Mar 2020 17:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584295161; bh=ooTtotCxj4FN51+o+o5KvI92R+015dWBAK0qfGoPVHQ=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=GopWpZgPHmRn4mrjcnQ7gPbZ4szw44CQmgy2sEjgpcaRbaeeMU42Ac8PjZhRfQEIa 02A4YCtsL/kgRPzmnP6HAMD0ttXJqWjPDfRSWrrQjsP0MdLDuZOULEp4kkGa0T+1B6 bMntSkij3K+OtrzPag5fO9lP43/l/PPeYRS/pfkI= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id A6F5635226D7; Sun, 15 Mar 2020 10:59:21 -0700 (PDT) Date: Sun, 15 Mar 2020 10:59:21 -0700 From: "Paul E. McKenney" To: Mathieu Desnoyers Cc: Frederic Weisbecker , rcu , linux-kernel , kernel-team , Ingo Molnar , Lai Jiangshan , dipankar , Andrew Morton , Josh Triplett , Thomas Gleixner , Peter Zijlstra , rostedt , David Howells , Eric Dumazet , fweisbec , Oleg Nesterov , "Joel Fernandes, Google" Subject: Re: [PATCH RFC tip/core/rcu 0/16] Prototype RCU usable from idle, exception, offline Message-ID: <20200315175921.GT3199@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200312181618.GA21271@paulmck-ThinkPad-P72> <20200313144145.GA31604@lenoir> <20200313154243.GU3199@paulmck-ThinkPad-P72> <2062731308.28584.1584294305768.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2062731308.28584.1584294305768.JavaMail.zimbra@efficios.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 Sun, Mar 15, 2020 at 01:45:05PM -0400, Mathieu Desnoyers wrote: > ----- On Mar 13, 2020, at 11:42 AM, paulmck paulmck@kernel.org wrote: > > > On Fri, Mar 13, 2020 at 03:41:46PM +0100, Frederic Weisbecker wrote: > >> On Thu, Mar 12, 2020 at 11:16:18AM -0700, Paul E. McKenney wrote: > >> > Hello! > >> > > >> > This series provides two variants of Tasks RCU, a rude variant inspired > >> > by Steven Rostedt's use of schedule_on_each_cpu(), and a tracing variant > >> > requested by the BPF folks and perhaps also of use for other tracing > >> > use cases. > >> > > >> > The tracing variant has explicit read-side markers to permit finite grace > >> > periods even given in-kernel loops in PREEMPT=n builds It also protects > >> > code in the idle loop, on exception entry/exit paths, and on the various > >> > CPU-hotplug online/offline code paths, thus having protection properties > >> > similar to SRCU. However, unlike SRCU, this variant avoids expensive > >> > instructions in the read-side primitives, thus having read-side overhead > >> > similar to that of preemptible RCU. > >> > > >> > There are of course downsides. The grace-period code can send IPIs to > >> > CPUs, even when those CPUs are in the idle loop or in nohz_full userspace. > >> > It is necessary to scan the full tasklist, much as for Tasks RCU. There > >> > is a single callback queue guarded by a single lock, again, much as for > >> > Tasks RCU. If needed, these downsides can be at least partially remedied > >> > >> So what we trade to fix the issues we are having with tracing against extended > >> grace periods, we lose in CPU isolation. That worries me a bit as tracing can > >> be thoroughly used with nohz_full and CPU isolation. > > > > First, disturbing nohz_full CPUs can be avoided by the sysadm simply > > refusing to remove tracepoints while sensitive applications are running > > on nohz_full CPUs. > > I doubt this approach will survive real-life. Nothing survives real life, at least not indefinitely. ;-) > > Second, for non-CPU-bound real-time programs with mostly-idle CPUs, > > I should be able to decrease the likelihood of sending IPIs pretty much > > to zero. > > > > Or am I missing something here? > > I would recommend considering the following alternative for this tracing-rcu > flavor: > > - For all CPUs which are not nohz_full: > - Implement fast RCU read-side which only requires compiler barriers, > - Use IPIs to each of those CPUs when doing a grace period. > > - For all nohz_full CPUS: > - Dynamically detect CPUs which are nohz_full, > - Implement slower RCU read-side with memory barriers, > - No need to issue any IPI to those CPUs when doing the grace period. > > This should cover all use-cases: staying fast for the common case, without > disturbing RT workloads. > > Thoughts ? I will certainly add this to my list of potential solutions, and thank you for pointing me at it! Thanx, Paul