Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3410124imm; Sun, 14 Oct 2018 19:51:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV62TBVlbLGgO+UuRstmWpdEZKzpWhE9VlI1hc0ro1zwToVfASfbxzD3UUR1Dr5dfkJHbVwk7 X-Received: by 2002:a62:14ce:: with SMTP id 197-v6mr15788228pfu.50.1539571914461; Sun, 14 Oct 2018 19:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539571914; cv=none; d=google.com; s=arc-20160816; b=SVOxIMCOR8wmVJfpUWjTuRP0d12xLBJCtBQWsk3OBeqlVnNaislyPqXlqwES59IrCP F908Zu9NBmBzKWxfatVPQUKHkSq3sNY4aWPPwoNtjWz7deXsOwJv6qDwS870LzKbLkwI BxkKoz5JykFyQcwyUyVfqr2ZOfpDS1Hku6hiJosG6TuzQdN+JxV1Qj2lQwvHed9dTP/a +YevZJl9RE8XCDAuVYGzZhfGkoBGqjs0C7FYTzuFPlxbXxAdUnVEz7FrvLXcYE3xzab9 lilwgPgl+r4xlxHTu13ERGM6hBrEpHbtX9dqnqIoEPGoFc8bsRCLYAi9F2d4cVvQeB5N WSoA== 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; bh=x9Ypx7mHDlNqWFPYdjNz4Er2OMIsLBchG9a1Lbx78oE=; b=yS3zkHH7FxVNvSDQCQH8exeuZ+cBM/JjfrHLeqg8M7qwpMjUlTeajc5g2kctwxTbJr kAW+bXeFRDsvMhOx4zoXivUY06Q3WwskHhTsTkM91JOTf4vMQXQbBZEbdI0l/VZ9Wzlg KvrABlNz/JyawSkGQzjT1BzRzSHZthmkyBJnymxbu2apnE5+ByqatlX5qxmZxRYnwRV7 fNdjSIRiy0ZGkDKHBs9noyUhvIUMNlUn9dhgJfsxio9RYe9ouiu30l5wxAkHMQbt1c+R vHDF80kdQ9OQtaq/gQKHm+s+/w71wFY/mMCBQrD27UjyJRV5A0jNx9Uo/+S6E9/GiJjw ikpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=HmaWNQMw; 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 h21-v6si9430359plr.98.2018.10.14.19.51.39; Sun, 14 Oct 2018 19:51: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=@joelfernandes.org header.s=google header.b=HmaWNQMw; 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 S1726581AbeJOKeM (ORCPT + 99 others); Mon, 15 Oct 2018 06:34:12 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46011 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726368AbeJOKeM (ORCPT ); Mon, 15 Oct 2018 06:34:12 -0400 Received: by mail-pg1-f196.google.com with SMTP id t70-v6so8417423pgd.12 for ; Sun, 14 Oct 2018 19:50:59 -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=x9Ypx7mHDlNqWFPYdjNz4Er2OMIsLBchG9a1Lbx78oE=; b=HmaWNQMwc4CA//hcrZtLyaNi1y8ch1nYitPRdTc72YyUxMCQBZvGgge6f0VcoYgTCf Chb/97zWnCa0KwWRz/rZVQrMTUPrrGYZcmAJXmzQzy2s8ypEZk9d/6Ef7RT1BgcsMKVl cKy0LmX+JgZX8NRkqQs+yIFLZvLqNiPXHP9js= 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=x9Ypx7mHDlNqWFPYdjNz4Er2OMIsLBchG9a1Lbx78oE=; b=JJqkxTBJ4bo/zss4kdGZsB+iXB0jhtzRqclNoi6Iri/xN2DVNegGr14cBZFDv7PxeI wzI2rbrL7qmbbSEmhLaoAPbGUxZzYASRejFIIInfs/OhW1t4YIP/xtsGtei065x2NfCr IsSWss8QKl55JZg/rv+6A1FNGLlirxyJ7zmlqQaa4nsWRl59OpQtJ4n91lvlvweNeP9K XHPkZKc7tzeC1MuN67dXfLozaI5zB9EnrYlBSEdgMmaayGG8EymMRDD6QFXh/3BTzwWt T+FJHdxvfjh3BEB+cq/xKkaZGUdKyyXFd6IrsHHdnX0c1jkhjRgfBrnKJ2PvPvAbky2K rpsg== X-Gm-Message-State: ABuFfoikLJfBCj4fSjPZdMJj4/X1Y2U1WYMAjoax5tWAY51bbnGnuds0 K4rZShUprIDI8B+0g7MCZBPafQ== X-Received: by 2002:a62:5887:: with SMTP id m129-v6mr15636425pfb.254.1539571858725; Sun, 14 Oct 2018 19:50:58 -0700 (PDT) Received: from localhost ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id t4-v6sm10239938pfh.45.2018.10.14.19.50.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Oct 2018 19:50:57 -0700 (PDT) Date: Sun, 14 Oct 2018 19:50:56 -0700 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, Jonathan Corbet , Josh Triplett , Lai Jiangshan , linux-doc@vger.kernel.org, Mathieu Desnoyers , Steven Rostedt Subject: Re: [PATCH RFC] doc: rcu: remove obsolete (non-)requirement about disabling preemption Message-ID: <20181015025056.GA25774@joelaf.mtv.corp.google.com> References: <20181014212955.95267-1-joel@joelfernandes.org> <20181014231731.GN2674@linux.ibm.com> <20181015020827.GA217384@joelaf.mtv.corp.google.com> <20181015021349.GB217384@joelaf.mtv.corp.google.com> <20181015023328.GP2674@linux.ibm.com> <20181015024758.GA227989@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181015024758.GA227989@joelaf.mtv.corp.google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 14, 2018 at 07:47:58PM -0700, Joel Fernandes wrote: > On Sun, Oct 14, 2018 at 07:33:28PM -0700, Paul E. McKenney wrote: > > On Sun, Oct 14, 2018 at 07:13:49PM -0700, Joel Fernandes wrote: > > > On Sun, Oct 14, 2018 at 07:08:27PM -0700, Joel Fernandes wrote: > > > > On Sun, Oct 14, 2018 at 04:17:31PM -0700, Paul E. McKenney wrote: > > > > > On Sun, Oct 14, 2018 at 02:29:55PM -0700, Joel Fernandes (Google) wrote: > > > > > > The Requirements.html document says "Disabling Preemption Does Not Block > > > > > > Grace Periods". However this is no longer true with the RCU > > > > > > consolidation. Lets remove the obsolete (non-)requirement entirely. > > > > > > > > > > > > Signed-off-by: Joel Fernandes (Google) > > > > > > > > > > Good catch, queued, thank you! > > > > > > > > Thanks! By the way after I sent the patch, I also tried Oleg's experiment to > > > > confirm that this is indeed obsolete. :) > > > > > > > > One thing interesting came up when I tried synchronize_rcu_expedited() > > > > instead of synchronize_rcu() in Oleg's experiment, I still saw a multiple > > > > millisecond delay between when the rcu read section completely and the > > > > synchronize_rcu_expedited returns: > > > > > > > > For example, with synchronize_rcu_expedited, the 'SPIN done' and the 'SYNC > > > > done' are about 3 millisecond apart: > > > > [ 77.599142] SPIN start > > > > [ 77.601595] SYNC start > > > > [ 82.604950] SPIN done! > > > > [ 82.607836] SYNC done! > > > > I saw anywhere from 2-6 milliseconds. > > > > > > > > The reason I bring this up is according to Requirements.html: In some cases, > > > > the multi-millisecond synchronize_rcu() latencies are unacceptable. In these > > > > cases, synchronize_rcu_expedited() may be used instead,.. so either I messed > > > > something up in the experiment, or I need to update this part of the document ;-) > > > > In normal testing, 2-6 milliseconds is indeed excessive. Could you please > > point me at Oleg's experiment? Also, what CONFIG_PREEMPT setting were > > you using? (My guess is CONFIG_PREEMPT=y.) > > The CONFIG_PREEMPT config I am using is CONFIG_PREEMPT=y. > > > > So I realized I'm running in Qemu so it could also be a scheduling delay of > > > the vcpu thread. So apologies about the noise if the experiment works fine > > > for you. > > > > I used rcuperf, which might not be doing the same thing as Oleg's > > experiment. > > The experiment is mentioned at: > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg912055.html > > If you apply the below diff, it applies cleanly on rcu/dev. And then run: > taskset 2 perl -e 'syscall 157, 666, 5000' & > taskset 1 perl -e 'syscall 157, 777' > > diff --git a/kernel/sys.c b/kernel/sys.c > index cf5c67533ff1..b654b7566ca3 100644 > --- a/kernel/sys.c > +++ b/kernel/sys.c > @@ -2261,6 +2261,9 @@ int __weak arch_prctl_spec_ctrl_set(struct task_struct *t, unsigned long which, > return -EINVAL; > } > > +#include > + > + > SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, > unsigned long, arg4, unsigned long, arg5) > { > @@ -2274,6 +2277,19 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, > > error = 0; > switch (option) { > + case 666: > + preempt_disable(); > + pr_crit("SPIN start\n"); > + while (arg2--) > + mdelay(1); > + pr_crit("SPIN done!\n"); > + preempt_enable(); > + break; > + case 777: > + pr_crit("SYNC start\n"); > + synchronize_rcu(); By the way, just to mention, this needs to be changed to synchronize_rcu_expedited() and then built. So with that I see the multi millesecond delay. thanks, - Joel