Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp332416imm; Tue, 22 May 2018 20:10:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrXPeIJ9eK6T52KVvm2j0UAfuRlpwXR9eHPwY8kgbfMPf8/hO0oweGCMeAZp0TMggP7GH6G X-Received: by 2002:a62:ba09:: with SMTP id k9-v6mr1047693pff.245.1527045042235; Tue, 22 May 2018 20:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527045042; cv=none; d=google.com; s=arc-20160816; b=KQ90ZLhQVP/nwkbheiJgVvmeOIsas8eIs4pX7+wiHtw5eMZXFsdI8NwfEiJoyVFxK2 2yWCPZytZV+QMwvJPt5olL22fN4CNPtIRDIqxf2kYDySsYyCDywFpQkuPyPz3RWYsx88 lQ0vkGQUgQwSmOaYzZzaej44smanuKiUqgx8RSRbiBnbNETBeir9nX9Q4iXwKsAvjOPk Wf5od+/YooWQuEvwxqrybq0i4YU1/GOIZOx2Is53gtRFuZi6+Mdx+kPydo1FtvR3B33D myQhU8lLaCmlD2JUGe8VxjlNVuOSlvhEM0Pspo/XOyK4aS2mpQfAvgbxqFuCKGzoeZab FknQ== 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:arc-authentication-results; bh=EdKTceED5VcufNJrDI7gXc4IeYzruWzDNES9EyH3ys0=; b=YRusWQ6iNua8R8l5nFlFdXgUmAfv5sqK0q7hxhpdWv4SC8jF4V+oXyQZf+uh4khnmQ JcoSQ7qWxxBzgYcRTDEiNI4LcjDJBHnfTclgnWGAyb4nf2kYN4u0RXliSQJq6fVDR0Y9 ycpuYPqtPHfhlfCwxllNFh0pkOTivGkODW4iHiLDYeFd4xwt+OJGVeGT+GTwtnUWyjGD hhIdad0XXKyBAIn2WkG3QfO39m9WavbBPnunZQqdFA34zTHov1FX1SXXmt7/s9Fe2g6D y4WFkjV8ExAq+QB7i1cXKQpiKyt8LE1OAn7imqBrcYqoENfLF9uHAe2fpEJOrL9L82jN OgEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=k4FA1E1X; 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 h185-v6si278170pgc.296.2018.05.22.20.10.14; Tue, 22 May 2018 20:10:42 -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=@joelfernandes.org header.s=google header.b=k4FA1E1X; 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 S1753745AbeEWDKG (ORCPT + 99 others); Tue, 22 May 2018 23:10:06 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36263 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753165AbeEWDKF (ORCPT ); Tue, 22 May 2018 23:10:05 -0400 Received: by mail-pg0-f67.google.com with SMTP id u7-v6so233505pgp.3 for ; Tue, 22 May 2018 20:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EdKTceED5VcufNJrDI7gXc4IeYzruWzDNES9EyH3ys0=; b=k4FA1E1XJHToq0+JPqmqYvoQ1lor377gRhjqwgKq4tcA7cJhUq/QqPdNEYc4ygUBCO WDMvWSFBZ272OcspDUKUT1d4UbMnAZVlRcvhTyO3EkPqerSDZncqPiSbKPilbtn5xAac QICy+Jtk8YhzrcdRDsCWHLyTW2OowWdbLzab8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EdKTceED5VcufNJrDI7gXc4IeYzruWzDNES9EyH3ys0=; b=XR9BKfop6IcqIO/xz75gyk15sgjB8tx05+fOIfmdsx6R39ZXHD1zsere1xCwuq9P/k esNhqjAw3THOLIenV6hGsK05raBHLQYgVao2H49BGuZ+hRoa8702YA+5+/YU6Otip6MW eXgmfrKZPuUb1+T00m8+mWgQvtDID938LyO6TZT2oQvXaatiJfpEERND4KEXJ9/t0OAk zad/noDPmU8Kueqlj5aDu/3SWNm5w1AjTfN3Jxh4SOiVTAiuoi3z+zuj/vDKmGBKrrst 6uu1ar2EIyt4Sp0Z7B5XvzqUSsO5AMYEDngTUuMyCLaOypZdwgVylDRCk6trmDGF2qlY FAgA== X-Gm-Message-State: ALKqPwebxVLB95K+tWRabvVZX67wXLcC2/sE0HysXiSF6LtgdskOWkO1 DoQuFF+GuLaTMFUe4hJeC0OeQw== X-Received: by 2002:a62:859a:: with SMTP id m26-v6mr1034149pfk.247.1527045004939; Tue, 22 May 2018 20:10:04 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id u14-v6sm40152320pfa.101.2018.05.22.20.10.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 May 2018 20:10:03 -0700 (PDT) Date: Tue, 22 May 2018 20:10:03 -0700 From: Joel Fernandes To: Steven Rostedt 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: <20180523031003.GA60111@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> <20180522083832.45353d5f@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180522083832.45353d5f@gandalf.local.home> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 22, 2018 at 08:38:32AM -0400, Steven Rostedt wrote: > 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. Right. I totally missed that. Ofcourse, its not sufficient to see if a CPU is in usermode. :( > > 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? Again, my motivation was just to see if we could use RCU-preempt. Linus was talking about unifying RCU variants/API better. I believe Paul is well on top of that task and I have been helping as I could with his recent series for that. Since RCU-preempt doesn't suit this job, looks like we have keep RCU tasks around. That said I sent you a patch to speed up RCU-tasks a bit, could you a take a look? Paul was asking for your input: https://lkml.org/lkml/2018/5/20/263 Welcome back from your vacation, hope it was fun! thanks, - Joel