Received: by 10.223.185.116 with SMTP id b49csp3822777wrg; Tue, 6 Mar 2018 05:39:46 -0800 (PST) X-Google-Smtp-Source: AG47ELt74ClXnllHZ9M5T1Au9Go8CsQ4kMk7LFCdC+/ynr01F3I5PsemQukxM/m4PYbxbvyXzAaA X-Received: by 10.101.97.139 with SMTP id c11mr14430217pgv.431.1520343586090; Tue, 06 Mar 2018 05:39:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520343586; cv=none; d=google.com; s=arc-20160816; b=jx9MeRKQerwFGbnYjeRh6nOPPnK9SecscuWYWZp0ZhOCmCM1yCTRiXNJ7YbZPVFrqH T2TpmvzCM+5JT4M8UR2q7xI6SixoBO92FosuwPAWViSQ3lcipczSxqjvdLBbOi2ldbHt copn4kJRcqGPRAffdFUC69pfMtx/iujMTk9HcuGlt71DGDwnMV0kPdCc+bUuowc2Sr3O NnV4F8fuwo7GbBwsEWvvVWMheE3foz0shBr++uspIbcXIfG+V7Vjda2bANPI60sDFES/ Gp7aVydnqqWysAJjCxKfjO5dpzIAWXN9CmB29qjbuvHTY3+w7dpYnhZl5JhK4G8i09Tf 6aUQ== 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=nOlYibJQdwrfDnXy6OlX1LUxSfyKZ18i3VU2WTx+IGY=; b=uQ06pS5iBsyqwBcuks1kcNk1eBrU9goYZFXTSMd6KbNsmiTTIZffwEdJJy7nAT+R4/ bnhjI9hiDFcaFK0cVQJnYJFTYvQ1s6+4GR4VoFXYvxn1tq/QXr0kcYR1qhrYT14+Bstx nnDXefm5k48x7Ou+9VF/TtbDlMuj8tfYNe0sdEbH4Lc79Sg0kF0kQRwXczukZoeQFxeF MQQw89pm+cHOk/Fk4QU4Kzm3BTlISd66z0panmxA0LuN5kYngXnFXGaJtiSMhl/TmDr0 3bGpRC1xIcw7F3T89kof3o9qcqTNKs79Rf1MUBuYhNPcNnu9xme5MFNbVrJL/TD9Ihep 5Zig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ogjn9hZC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si9803689pgn.429.2018.03.06.05.39.30; Tue, 06 Mar 2018 05:39:46 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=ogjn9hZC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753344AbeCFNid (ORCPT + 99 others); Tue, 6 Mar 2018 08:38:33 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39663 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbeCFNic (ORCPT ); Tue, 6 Mar 2018 08:38:32 -0500 Received: by mail-wm0-f67.google.com with SMTP id i3so22208702wmi.4 for ; Tue, 06 Mar 2018 05:38:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nOlYibJQdwrfDnXy6OlX1LUxSfyKZ18i3VU2WTx+IGY=; b=ogjn9hZC8tsNxEtBz8Z275sdGpRLdpt8xeCWRXsMNRPu9kebItGltILZHBbDnUGtgG 1C5/94WysNpoxmhUOXX1TzfhyoXee1DWqbBgsmQLUF8P+uEHVWaA3kwcgzZHSbmdlv/F oVn6yTbj4hysGr7krsQQrlehd8n0h2iFAyvjqThXXyFK+UEXfSkwqIEFzml7pnhk16Zy PXMmv1MMAbaGRr6MG3gIlPuY7IcUSojmrXduEsSQwfQmFi62j4txyAe3npNhmGfywLuu 1Pv54X5sRWiZnrAxkQDcPZxoWonfym5oZDaqTP+i7ibFh7zoX/jjnrM6bWAxYvxLsPvn wbfw== 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=nOlYibJQdwrfDnXy6OlX1LUxSfyKZ18i3VU2WTx+IGY=; b=O+ZBDlgS3frtVwL/OIzJgeaPEOa9bJgvz3oOuBMyFcqa1UdMYMx+OMOSC2EI01igps 40kI8lBzuzqaaP3HZv1CWYn9Vaz22uZEfAeqhaj/jHBXyQJA6EtfHQ5nyo711QEwgGzF HX60hNzzEkMLcNNLL7TcRtxKU2g09F6RHiIp1CGi4W0Sjao5jj6ExvBGDqg0m7HAlhkM ts1xhKbhkUPv4seaQXdz98gFg3o+I8Kg7Q1Gg589ZVunX3OBFIqddWYns2lfhFy6rddV U59XAAdIBSdWMQOTPZ5Uxe6WqGQKqCJIWEtut139bKP6ZZ3ZWGfmpMfiX4IUGcOdmFNM hGig== X-Gm-Message-State: AElRT7E7X3dJGysS8thVG1z0AjndNv1gP1ya23LuXFK5m6QP3u3lOg8o F1y+RaHXvNl3uryUAFM40BY= X-Received: by 10.80.231.18 with SMTP id a18mr3016965edn.240.1520343511266; Tue, 06 Mar 2018 05:38:31 -0800 (PST) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id g50sm7965983edb.56.2018.03.06.05.38.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:38:30 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 43B7020BDE; Tue, 6 Mar 2018 08:38:27 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Tue, 06 Mar 2018 08:38:27 -0500 X-ME-Sender: Received: from localhost (unknown [45.32.128.109]) by mail.messagingengine.com (Postfix) with ESMTPA id BAF577E498; Tue, 6 Mar 2018 08:38:26 -0500 (EST) Date: Tue, 6 Mar 2018 21:42:05 +0800 From: Boqun Feng To: Byungchul Park Cc: jiangshanlai@gmail.com, paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [RFC] rcu: Prevent expedite reporting within RCU read-side section Message-ID: <20180306134205.lwmn3cgisnwkngcf@tardis> References: <1520314318-30916-1-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pfxu7pqvkrvnrzvc" Content-Disposition: inline In-Reply-To: <1520314318-30916-1-git-send-email-byungchul.park@lge.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pfxu7pqvkrvnrzvc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 06, 2018 at 02:31:58PM +0900, Byungchul Park wrote: > Hello Paul and RCU folks, >=20 > I am afraid I correctly understand and fix it. But I really wonder why > sync_rcu_exp_handler() reports the quiescent state even in the case that > current task is within a RCU read-side section. Do I miss something? >=20 > If I correctly understand it and you agree with it, I can add more logic > which make it more expedited by boosting current or making it urgent > when we fail to report the quiescent state on the IPI. >=20 > ----->8----- > From 0b0191f506c19ce331a1fdb7c2c5a00fb23fbcf2 Mon Sep 17 00:00:00 2001 > From: Byungchul Park > Date: Tue, 6 Mar 2018 13:54:41 +0900 > Subject: [RFC] rcu: Prevent expedite reporting within RCU read-side secti= on >=20 > We report the quiescent state for this cpu if it's out of RCU read-side > section at the moment IPI was just fired during the expedite process. >=20 > However, current code reports the quiescent state even in the case: >=20 > 1) the current task is still within a RCU read-side section > 2) the current task has been blocked within the RCU read-side section >=20 If this happens, the task will queue itself in rcu_preempt_note_context_switch() using rcu_preempt_ctxt_queue(). The gp kthread will wait for this task to dequeue itself. IOW, we have other mechanism to wait for this task other than bottom-up qs reporting tree. So I think we are fine here. Regards, Boqun > Since we don't get to the quiescent state yet in the case, we shouldn't > report it but check it another time. >=20 > Signed-off-by: Byungchul Park > --- > kernel/rcu/tree_exp.h | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h > index 73e1d3d..cc69d14 100644 > --- a/kernel/rcu/tree_exp.h > +++ b/kernel/rcu/tree_exp.h > @@ -731,13 +731,13 @@ static void sync_rcu_exp_handler(void *info) > /* > * We are either exiting an RCU read-side critical section (negative > * values of t->rcu_read_lock_nesting) or are not in one at all > - * (zero value of t->rcu_read_lock_nesting). Or we are in an RCU > - * read-side critical section that blocked before this expedited > - * grace period started. Either way, we can immediately report > - * the quiescent state. > + * (zero value of t->rcu_read_lock_nesting). We can immediately > + * report the quiescent state. > */ > - rdp =3D this_cpu_ptr(rsp->rda); > - rcu_report_exp_rdp(rsp, rdp, true); > + if (t->rcu_read_lock_nesting <=3D 0) { > + rdp =3D this_cpu_ptr(rsp->rda); > + rcu_report_exp_rdp(rsp, rdp, true); > + } > } > =20 > /** > --=20 > 1.9.1 >=20 --pfxu7pqvkrvnrzvc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAlqemn8ACgkQSXnow7UH +rhg9Af8D2Gy9EriR85bXMNTebiYdi07gdNO3gFzL7MyscRHKzV1BZkRpDVTifg4 eoulZpXnJhTdSRYBVmjemv8KUQQ6jeUwodbVMfhfStWWB07BZHXzJ/JHzqNTl0oe fOtuKnedHdNWLPTGEYXB1yQiCJx1Z4f8kstmLDFYvoZZtNNRgvjCsqBWqmY9o/1d qVG+m2etRrNfFx1BJkAJz3Avck7PF1lHIJj9QgYX98i98orYEns/jE0jCbZXEQ1b ZOmMNQvEQuem7vJCv+3+em12VVjTjUdkdp8jzl5D3xmoIEilHTItHXRQBM9C8bYl v2gco+hAc/XwwwhghclI4LODV3OH4Q== =b8kU -----END PGP SIGNATURE----- --pfxu7pqvkrvnrzvc--