Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3408255imm; Sun, 14 Oct 2018 19:48:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV61YSnMDDyUGIEvsULFVsecjeypucHuVMdVVvRKxRsHlA5n7zsONQWRf7PbnUQwqKHNfgvcM X-Received: by 2002:a62:6dc3:: with SMTP id i186-v6mr15891236pfc.218.1539571716960; Sun, 14 Oct 2018 19:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539571716; cv=none; d=google.com; s=arc-20160816; b=BLRyigLqbyJXAqSKrqRXPUYt48TITKQ6qXnauXpQNTqnYEujZnYAI0y2uUjazEVQxm oxcZAn81BchEWn7YdQhAXDmCEBs0I2XFO/yTuNFHapFv1a69WRTdsBb/OlTGry9Pwrtt hv3aSmfR7WajPrg6OTleZywsVcV7hQiUQT0qMIyxjDjCSyCm2+r0zTZEapOVZ/6Vk4EJ VhugHl16ca50Kk4HfUZUYoaKxPHCUZB+D2gYn14B2+PqSOemOdZTIHzxo50q+949nplo dQh86b3KTBIfhI0PloPZ53oOc3WQHvb7jTlrHIfDilZu+BsAK59XkefUlFwYRCQoLE2h PwmQ== 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=CfP9bckGZAz9VDsWFkEm+7rjWCsijRJ0HBC+jzrBiDI=; b=qIVWsJ2vdy9+79S8B1zh3mt0RA/NTjJ+pFSRra8/MLfwbMpeGPXB7XlijKAPtmAqvk Te1FfQ93WjIkm6W6p1WQBlcWwKhQqwjcqRiLUimtxRHXi1GkFmkDbtEGQkuvHSbuRXIB c8GTEKfvgXe6rFXEMvXr6UkIYSfNxlEBd1gscjdQ2QqnodLjROHszkgShHmEtnZQh/Oi 8P2NGmSPChRUEyUp3wrg4r+so9lYzSyKGBhMRhyJQ4tWy4aQSccJRPgT6S7Ecvr3iI5h YiOz9i7lOqV9mQ28Q+TpxRxCPpBt/urdiN5AIas5ZpAQLf3NJR9tsNobq1Qx1BlUN682 /FIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Pmoy8HpV; 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 89-v6si5746626plc.383.2018.10.14.19.48.21; Sun, 14 Oct 2018 19:48:36 -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=Pmoy8HpV; 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 S1726474AbeJOKbO (ORCPT + 99 others); Mon, 15 Oct 2018 06:31:14 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39400 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbeJOKbO (ORCPT ); Mon, 15 Oct 2018 06:31:14 -0400 Received: by mail-pg1-f194.google.com with SMTP id r9-v6so8429042pgv.6 for ; Sun, 14 Oct 2018 19:48:01 -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=CfP9bckGZAz9VDsWFkEm+7rjWCsijRJ0HBC+jzrBiDI=; b=Pmoy8HpVGV3aorg0pZ8Xg9o7wELAyl7Ts5KdYmWq8olmgzEIdQSh6R2RSjUWssWwQ9 rZ+Fi3aSsDODiD1/XrLkdGNLknZKyhHXYBgJcCCALMi+u4Uyx0sqKCJ4BsLiJobYM+PW nLUiC+x6AZxrql4e/eXgp2z2shTxmgPCHUBSc= 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=CfP9bckGZAz9VDsWFkEm+7rjWCsijRJ0HBC+jzrBiDI=; b=Lrj5+ngXar0+NesetiO+9kVm6gLi7jg73oeLVKGu+2GpLGq25z3W/4Zyqa0s88KECm kHFmJ4slHG96Js+Uyz+Z4Sosl4S7+Oz29TTVaD+TjVCxHsWZ0fssTBjZAkso7sk++G86 ldgMG6R2351XD8Uv5b76TMu3YcUE4jU8Up4qdXt59rzdAJ4y2jmrrBclv9qFcWYkRxjJ E20wL7hxcbjZAVihRFD8MaXfnBQe1VqzVztI4sYlHdzUnk9FJgbE3PbUS0i5ttAJZlxM wyal7QBnhVSRR1+wYxS054WH070mO4qPLlbH/wJwEtHDUj2pv1PGz1etilvS4ai+E5+A Fdwg== X-Gm-Message-State: ABuFfojuQkk10c05FyT8UHQplIJStJC/eX5IhhFrVZMaODK4d2LX6Eoa 9VrucI3zQ/ee/eietyQMPexx4A== X-Received: by 2002:a62:384c:: with SMTP id f73-v6mr15756296pfa.242.1539571680364; Sun, 14 Oct 2018 19:48:00 -0700 (PDT) Received: from localhost ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id 6-v6sm10562838pgl.6.2018.10.14.19.47.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Oct 2018 19:47:59 -0700 (PDT) Date: Sun, 14 Oct 2018 19:47:58 -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: <20181015024758.GA227989@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181015023328.GP2674@linux.ibm.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: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(); + pr_crit("SYNC done!\n"); + break; case PR_SET_PDEATHSIG: if (!valid_signal(arg2)) { error = -EINVAL;