Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp6043601imm; Sat, 19 May 2018 15:59:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrk9IeoNG1KKNIVy+KMHsbx6FbpLIsyb8VDgpA5RlxX5fEp4ycMo83qWhjc+OImznZEVX6U X-Received: by 2002:a17:902:82c3:: with SMTP id u3-v6mr14737298plz.83.1526770781365; Sat, 19 May 2018 15:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526770781; cv=none; d=google.com; s=arc-20160816; b=N+KO7wAvNAKzHpC9dZWFIo4M8Tq9NzvnuHggsUzqKBYiIW07Jkck3rpZliQv2ZkPIW AQifgmDwlL6u8otSFI1p2cDdf29+Jend2JiFhcKNlSkH8z7lLlvawaHXSwSZu1s3UDYm l2c4tT2bewK1u/58iwQPMOuNZw9mi/xpX8gjLXkO6Mgc042MRb1YlrE2V3d/lqGisKMK cNepZVryk4d0xZzyJhrGYVVB/XRjOzKz+PJMfCCmnBGf0S0ncsp8fAppclurc2iofsuC eh6jYqhhXTm+rAcQ4KMoYpWcn+kV0NeMY/Bbrsxv2bBr3Qu+SkOG9GovhU0uu6vze08l TCXg== 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=eV1VYYNwiiYC6AJrT49IJ3Hv2do2hJ8yM8UBW/Vf0mQ=; b=ZBtw7k43RZOC7VjGiawZ5A/knjrVY5dJpTL7Xql1QyWT8ZlsHybyX96RR2unDQ2aVu e8ab0mbttJX0ZTXCukDRGdXycvD8XPfrerh7ca7P9k2Y5HL8Ptm9Nxo5IIjlZj3G/pCj P1l5OprXjjphbhc6Uqi6xr9zLkCSwO6OZ+kpo3zRuEo1LAmedbi3NTHA8zBhOSsJC4AC jaeYwE//LgDASU6DBqwWF4CMAoGOWQCWxeew7g1/qywyWQvqpzY49ULqbIeNihCx1j0y add2pkoycWi0mXYLtQeHjibw3nSgCmZ2lRKzlXpjZMiAVmzBvlzFwBI8MjXG1pDl9fGx cFjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=C9Y4CCo9; 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 m8-v6si10154105plt.29.2018.05.19.15.59.26; Sat, 19 May 2018 15:59:41 -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=C9Y4CCo9; 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 S1752552AbeESW7J (ORCPT + 99 others); Sat, 19 May 2018 18:59:09 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:44877 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752045AbeESW7H (ORCPT ); Sat, 19 May 2018 18:59:07 -0400 Received: by mail-pg0-f49.google.com with SMTP id c22-v6so4107815pgn.11 for ; Sat, 19 May 2018 15:59:07 -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=eV1VYYNwiiYC6AJrT49IJ3Hv2do2hJ8yM8UBW/Vf0mQ=; b=C9Y4CCo9Wzaqs0ww88KT6zvw7Hf5zIH1Om9N8cUf8tTLd3QPFNfW3iyIIyo2K/gfDy 1ws6U57CMfr8WOfXB7xc8FDHxw4ECWOYajXrgXsWTNLRdnCdkOdI7S5dLM4BK1qh0mK5 /7dcbrrLQNSguGUOe/6O/P4cdKUjfJJxyuMBg= 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=eV1VYYNwiiYC6AJrT49IJ3Hv2do2hJ8yM8UBW/Vf0mQ=; b=ejeD/5/J2V4o3nlusb/WohEUesHezZ9oP+PtuDfQ+3cb+ta5QiG9fBfwZxWHteIB+A bFeWBYEWkEMAULSNaLp5rUYHtS89BadTcRE9pinovRHQUS9tPvL5kVfM8KDC8W6hcL+U qZqSofvGUP9j9GTwQQZNXBAGAH7KKfjYYAr5TfO+MvSndy6RJD7CC1UZ/YOrhJY+9blq QVWpPn8hdYdE/fIeaguRTD975BNeFnYE6C4b21BXMmMWOvskkfHCCcddwLBYdmeinZ3a ZozkVywl8LwZbOWlU8eDuu2+n5yVYtNYtsn7M0msu4ZmZVGw3qRZMGlHEHi9vuJ+RwmL cwIg== X-Gm-Message-State: ALKqPwcCMZml17aikO/8r9/ecdN7hpH+rdodbjJTlWgChGTGiP+Zmdcq IO86q5wEu30fXkHQ2GjeRh7biA== X-Received: by 2002:a62:de02:: with SMTP id h2-v6mr14619919pfg.205.1526770746991; Sat, 19 May 2018 15:59:06 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id f2-v6sm10055089pgp.28.2018.05.19.15.59.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 May 2018 15:59:06 -0700 (PDT) Date: Sat, 19 May 2018 15:59:05 -0700 From: Joel Fernandes To: "Paul E. McKenney" Cc: rostedt@goodmis.org, 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: <20180519225905.GB134184@joelaf.mtv.corp.google.com> References: <20180518183623.GA163151@joelaf.mtv.corp.google.com> <20180519022918.GV3803@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180519022918.GV3803@linux.vnet.ibm.com> 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 Fri, May 18, 2018 at 07:29:18PM -0700, Paul E. McKenney wrote: > On Fri, May 18, 2018 at 11:36:23AM -0700, Joel Fernandes wrote: > > Hi, > > > > I was thinking about tasks-RCU and why its needed. Since preempt-RCU allows > > tasks to be preempted in read-sections, can we not just reuse that mechanism > > for the trampolines since we track all preempted tasks so we would wait on > > all tasks preempted within a trampoline? > > > > I am trying to understand what will _not_ work if we did that.. I'm guessing > > the answer is that that would mean the trampoline has to be wrapped with > > rcu_read_{lock,unlock} which may add some overhead, but please let me know > > if I'm missing something else.. > > > > The advantage I guess is possible elimination of an RCU variant, and also > > possibly eliminating the tasks RCU thread that monitors.. Anyway I was > > thinking more in terms of the effort of reduction of the RCU flavors etc and > > reducing complexity ideas. > > The problem is that if they are preempted while executing in a trampoline, > RCU-preempt doesn't queue them nor does it wait on them. Not if they are wrapped with rcu_read_lock and rcu_read_unlock? From what I can see, you are preparing a list of blocked tasks that would keep the grace period from finishing in rcu_preempt_ctxt_queue? > And the problem with wrapping them with rcu_read_{lock,unlock} is that > there would be a point before the trampoline executed rcu_read_lock() > but while it was on the trampoline. Nothing good comes from this. ;-) Yes, I see what you're saying. The data being protected and freed in this case is the code so relying on it to do the rcu_read_lock seems infeasible. Conceptually atleast, I feel this can be fixed by cleverly implementing trampolines such that the rcu_read_lock isn't done during the trampoline execution. But I am not very experienced with how the trampolines work to say definitely whether it is or isn't possible or worth it. But atleast I felt it was a worthwhile food for thought ;) I actually want to trace out the trampoline executing as it pertains to RCU, with your latest rcu/dev.. I think it will be fun :) thanks! - Joel