Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1532595imm; Tue, 22 May 2018 05:40:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqA7twsRqYQVTTTkRSTXfzURe239UxesmArEhsr+rmF2WJLqnji+xbGIStpOM7RVsEhZ7Z4 X-Received: by 2002:a62:449c:: with SMTP id m28-v6mr24007950pfi.145.1526992815534; Tue, 22 May 2018 05:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526992815; cv=none; d=google.com; s=arc-20160816; b=xFqkS72P9ZY7iUOnw2AaEJ5710FO8EBJoVt17J8yu6AZ/KDe9KCHGwn4VRG37ZPwcE S8EWT0BcA7ULZEGqL46aDgmIc346bdxheDCs6BvuBewRhwq7r/FrIGx/3jGFk1b+TINW JR5vp+JjSSJXddbBg6MuR6WqrGXhyQnWXQF3OVfrBrzwrWpv3M1tIfOiXCGbyn/daU+T rGNIaZJAJfOsHaUJ5+fWkZHNsjonRdEaeCgVSuTR8UL7nyuT4GPII8sJF0SAyS8Jb1Im CsdzqSgrpLz/iTAFuRBBJRdd+WwVAcrl1ORx7I1SUDH4W3gAGKuyM9u0BrneBNLuEuQO 6ehg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=KcX6FDfMy41TYnVVNvGZeHzzqx4vJnoqyF69x/4wu+g=; b=K5HAZhBeeosWL2OG/S4j9mn8LCSjEbP3+TCDkWbqgLdFS8HhcDAf/KabDwU3kdOVKx auIdnNAXKpzBxoKiazc3NzXRL2fxYvU2APJp8S80yLPP64JPDYhpPmnTe7Lui8cjxKnO HRySfSpbeANjYLFAwDFWeUYWEhvoaczlAxOo/ssuL5A651pxEIJ5wpxm8yF3SOlDOaHo xpeQw7dRpBgwDGLzJ/mUg7P8fbcgXq1nvaNpLWTH+M/2T6Q1t7EWW/0tneCjolFsEfeq gv9d/PD04oixvfLUNb8NaWtn4zz0PZjYU6df641E91b+ZXQBK81cVgin8zaxoo572Bma ur2Q== ARC-Authentication-Results: i=1; mx.google.com; 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 u189-v6si5341476pgb.247.2018.05.22.05.40.00; Tue, 22 May 2018 05:40:15 -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; 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 S1751340AbeEVMig (ORCPT + 99 others); Tue, 22 May 2018 08:38:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:34190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036AbeEVMif (ORCPT ); Tue, 22 May 2018 08:38:35 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.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 EF8FC20853; Tue, 22 May 2018 12:38:33 +0000 (UTC) Date: Tue, 22 May 2018 08:38:32 -0400 From: Steven Rostedt To: Joel Fernandes Cc: "Paul E. McKenney" , byungchul.park@lge.com, mathieu.desnoyers@efficios.com, Josh Triplett , Lai Jiangshan , linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: Tasks RCU vs Preempt RCU Message-ID: <20180522083832.45353d5f@gandalf.local.home> In-Reply-To: <20180522045414.GG40541@joelaf.mtv.corp.google.com> References: <20180518183623.GA163151@joelaf.mtv.corp.google.com> <20180519022918.GV3803@linux.vnet.ibm.com> <20180519225905.GB134184@joelaf.mtv.corp.google.com> <20180520004938.GZ3803@linux.vnet.ibm.com> <20180520112843.57079857@grimm.local.home> <20180520191846.GA248075@joelaf.mtv.corp.google.com> <20180521215951.2d6abfcb@gandalf.local.home> <20180522045414.GG40541@joelaf.mtv.corp.google.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 May 2018 21:54:14 -0700 Joel Fernandes wrote: > Yes, lets brain storm this if you like. One way I was thinking if we can > manually check every CPU and see what state its in (usermode, kernel, idle > etc) using an IPI mechanism. Once all CPUs have been seen to be in usermode, > or idle atleast once - then we are done. You have probably already thought Nope, it has nothing to do with CPUs, it really has to do with tasks. CPU0 ---- task 1: (pinned to CPU 0) call func_tracer_trampoline [on trampoline] [timer tick, schedule ] task 2: (higher priority, also pinned to CPU 0) goes to user space [ Runs for along time ] We cannot free the trampoline until task 2 releases the CPU and lets task 1 run again to get off the CPU. > about this so feel free to say why its not a good idea, but to me there are 3 > places that a tasks quiescent state is recorded: during the timer tick, > during task sleep and during rcu_note_voluntary_context_switch in > cond_resched_rcu_qs. Of these, I feel only the cond_resched_rcu_qs case isn't > trackable with IPI mechanism which may make the detection a bit slower, but > tasks-RCU in mainline is slow right now anyway (~ 1 second delay if any task > was held). The way I was originally going to handle this was with a per task counter, where it can be incremented at certain points via tracepoints. Thus my synchronize tasks, would have connected to a bunch of tracepoints at known quiescent states that would increment the counter, and then check each task until they all pass a certain point, or are in a quiescent state (userspace or idle). But this would be doing much of what RCU does today, and that is why we decided to hook with the RCU infrastructure. I have to ask, what's your motivation for getting rid of RCU tasks? -- Steve