Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1778016ybh; Sun, 15 Mar 2020 10:48:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt+zwEv7cB3KA3XmlRbheg4MrotAIOJzjhwc/6pU8cjBREUkLHCdOTgY9edzg0Ds3uhF/Cw X-Received: by 2002:a54:4119:: with SMTP id l25mr14752559oic.83.1584294534619; Sun, 15 Mar 2020 10:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584294534; cv=none; d=google.com; s=arc-20160816; b=qUj7WSxvC1YweIGohRGBRu5H69cT5ICMOw8K0w9ejeUJ2Ti5WhxKSp9QywAsF4FiD6 nnZY8hHAuG/D1ZsCHSyOJwm7GocLLba6i91Sou7kcAB4V4+aFQ+ac/Y+TT9l0quT4oOB s6KMURb8/CnkwIX/EF57bHSiZ7w8yWvyKzNbMTC5oCZMG3V//lTLtQ59Os7zZ/X+YQSs 8+X8qrJzSe7EFTw6Em1d8zoYlPlmLCG8jsHBun7ym+TjY5KREf044G289g5INPux3d/6 U0Kp/494I75uoNrnyUrQ31/Y8EYRGgpdRNmjoLi4QZtestvp24GDVr1iGfudNYNa/nZ7 T7mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=TBC3tg+fQLWhANZZ+S2T6zpVClByqCGVvreSonLonsE=; b=i6M9B0XeNiveBU9r891LlFbnUQtmSSA7G23h9WJ71q2j1Dr33lBRsXCWjmE9taP3Jz hf8Mv0+FnTGOejVr9yizCVhLOqifnch+875ZOLB15GeT6R3hEYSX12y4wqph+edIF9sk 8wNkwNFLyRRAgZHcs9JU72qSyS0qSEoBVAanCMv9Fi2kq29mCcqvkcnmW6BGPrEwxbb8 3JQk9rYA8SlT35UI1g9tTTHF0HVk5soxzFa/UU8yFH2Dr0o7zOnxq8gfP4jMQmcdSqOf MTSeF/MisNT+G3fXx6Mfley+S7o8qCSOw0g1oS6ZTiSh+2mJ7BRUPuBmZEiJz+bL/mL/ c3mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=i2fD1vdq; 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=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5si9064895otn.216.2020.03.15.10.48.31; Sun, 15 Mar 2020 10:48:54 -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=@efficios.com header.s=default header.b=i2fD1vdq; 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=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729003AbgCORpH (ORCPT + 99 others); Sun, 15 Mar 2020 13:45:07 -0400 Received: from mail.efficios.com ([167.114.26.124]:55322 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728979AbgCORpH (ORCPT ); Sun, 15 Mar 2020 13:45:07 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 569BB25265B; Sun, 15 Mar 2020 13:45:06 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id uBRmkdaKLqTU; Sun, 15 Mar 2020 13:45:06 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id DD62D25265A; Sun, 15 Mar 2020 13:45:05 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com DD62D25265A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1584294305; bh=TBC3tg+fQLWhANZZ+S2T6zpVClByqCGVvreSonLonsE=; h=Date:From:To:Message-ID:MIME-Version; b=i2fD1vdquDb50EMgAM85zQXLibDdtL1GV8ui6FMpF1f5IAW5Opr2O8Zk2zT98Eqfs mMvMgQOZMiJqN4JkS9uj/3jjf8bRJgYb4joq5rdibQQ89C2PYZdhLUYy7FPLC9WpVd +wVkO2oOf4w14IhZG37AADRXcd6VsCIRdMXn8vfL1cVy/CfbxTcx7QSxM1bySyVL8q JEqn+OK1aUzjwUsWRjrqz/3ObF4+hGoklGovatjFnecaWC28tGb7sxbF2FqTvVO1e8 kNbDrZZJI4zWmlrSUJsjgH1FvDjYsybym991eu2TTZgNpKPKrKY2zQQjR03caCyvrX coR/+rvBh4fEA== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bq-mjMuJjExz; Sun, 15 Mar 2020 13:45:05 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id C726F253280; Sun, 15 Mar 2020 13:45:05 -0400 (EDT) Date: Sun, 15 Mar 2020 13:45:05 -0400 (EDT) From: Mathieu Desnoyers To: paulmck 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" Message-ID: <2062731308.28584.1584294305768.JavaMail.zimbra@efficios.com> In-Reply-To: <20200313154243.GU3199@paulmck-ThinkPad-P72> References: <20200312181618.GA21271@paulmck-ThinkPad-P72> <20200313144145.GA31604@lenoir> <20200313154243.GU3199@paulmck-ThinkPad-P72> Subject: Re: [PATCH RFC tip/core/rcu 0/16] Prototype RCU usable from idle, exception, offline MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3901 (ZimbraWebClient - FF73 (Linux)/8.8.15_GA_3895) Thread-Topic: Prototype RCU usable from idle, exception, offline Thread-Index: a/NhvL+0Mq6sqPjESRf5g9/gd7j1wg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- 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. > > 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 ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com