Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp48884imm; Mon, 14 May 2018 20:42:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoNegEGhSBwjVud3M16xgap8HtX9Ibg0zq4zFOqzDbcyzFJ7HTzmdbJv87KlOknXnPglnGF X-Received: by 2002:a63:7c01:: with SMTP id x1-v6mr10570716pgc.286.1526355724810; Mon, 14 May 2018 20:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526355724; cv=none; d=google.com; s=arc-20160816; b=S194NqMNGNLes7WDIFghYKR6CrQuZ+mmqcB4oKxWx1axYG26LDtE/LUb9bgdAExip9 Xtqkbfvpb4hD6rei7sWR1hGyuYk2EzzAtIQfMJMdz2OzqMEz7xrQvHoA8M5xLfHoPoRS cJv4kWE9Z+hiqFu83NZZYXPA+qrjhUYehdqwpCi7RNe6PZsstTt0ZpMI15iSB3YKSJ23 YqY6/aaGVVTE78oqfbG46mDtU8GZ4Bc/U1AjNPiO5FrmiPj50g2ya8VAjNHkdmP61Wn2 EW5xqdX/NlBjqa+G8WPLQ9v/63GjBx53k9luZfExxGD77LL/EkSdRd8cs4KtJPJESxRR ndLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=bqq/LWwjwo/KJwox2YrRyp/u4vL1LjrZi+/ABe00GCQ=; b=NE1TcM5c1E2PXyX9W7QBhKDM3uGMl3ofoLd1TD+pf2ZTCS406CfOQ4hxBfVL7M8LIg JUUlTiPhlpQMv+HxecV0h+uzXt39KLo3TRrdCTDPzV/HVbpsdfup8v4FsZ/1n4Yjd5ay gjAgto/IMnSIjCjUqURc/dHKqRUPIDKqCwJXy6GCTRh88DcC98p5HH/WTHrdVSm/HZNU YzCQFSTlvW7DU8UIe2rFm0pN05g9W02gngAYuejrVv6k6JvTSBGiuFbtBMuU/pGbCEYj dZVOIJmfq5l/BWZNvc/3ZdLyov5gi0btKEBMI5hPxCcjO2suqLG8uz6UMFuVl+98UIbF cV1A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r59-v6si10611487plb.187.2018.05.14.20.41.50; Mon, 14 May 2018 20:42:04 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752186AbeEODlY (ORCPT + 99 others); Mon, 14 May 2018 23:41:24 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47804 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009AbeEODlX (ORCPT ); Mon, 14 May 2018 23:41:23 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4F3dJNT069860 for ; Mon, 14 May 2018 23:41:23 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hyj5hu26h-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 14 May 2018 23:41:23 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 14 May 2018 23:41:22 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 14 May 2018 23:41:18 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4F3fIuU45416460; Tue, 15 May 2018 03:41:18 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4AF48B2046; Tue, 15 May 2018 00:43:16 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.132.95]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 0CCCDB204D; Tue, 15 May 2018 00:43:16 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 51F7316C3BCB; Mon, 14 May 2018 20:42:49 -0700 (PDT) Date: Mon, 14 May 2018 20:42:49 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , byungchul.park@lge.com, kernel-team@android.com Subject: Re: [PATCH RFC 2/8] rcu: Clarify usage of cond_resched for tasks-RCU Reply-To: paulmck@linux.vnet.ibm.com References: <20180514031541.67247-1-joel@joelfernandes.org> <20180514031541.67247-3-joel@joelfernandes.org> <20180514105454.45946ad3@gandalf.local.home> <20180514172205.GZ26088@linux.vnet.ibm.com> <20180515003555.GA209519@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180515003555.GA209519@joelaf.mtv.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18051503-0036-0000-0000-000002F4E0BA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009027; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000260; SDB=6.01032466; UDB=6.00527834; IPR=6.00811597; MB=3.00021117; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-15 03:41:21 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051503-0037-0000-0000-000044567DA0 Message-Id: <20180515034249.GX26088@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-15_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805150036 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 14, 2018 at 05:35:55PM -0700, Joel Fernandes wrote: > On Mon, May 14, 2018 at 10:22:05AM -0700, Paul E. McKenney wrote: > > On Mon, May 14, 2018 at 10:54:54AM -0400, Steven Rostedt wrote: > > > On Sun, 13 May 2018 20:15:35 -0700 > > > "Joel Fernandes (Google)" wrote: > > > > > > > Recently we had a discussion about cond_resched unconditionally > > > > recording a voluntary context switch [1]. > > > > > > > > Lets add a comment clarifying that how this API is to be used. > > > > > > > > [1] https://lkml.kernel.org/r/1526027434-21237-1-git-send-email-byungchul.park@lge.com > > > > > > > > Signed-off-by: Joel Fernandes (Google) > > > > --- > > > > include/linux/rcupdate.h | 11 ++++++++--- > > > > 1 file changed, 8 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > > > > index 743226176350..a9881007ece6 100644 > > > > --- a/include/linux/rcupdate.h > > > > +++ b/include/linux/rcupdate.h > > > > @@ -159,8 +159,12 @@ static inline void rcu_init_nohz(void) { } > > > > } while (0) > > > > > > > > /* > > > > - * Note a voluntary context switch for RCU-tasks benefit. This is a > > > > - * macro rather than an inline function to avoid #include hell. > > > > + * Note an attempt to perform a voluntary context switch for RCU-tasks benefit. > > > > + * > > > > + * This is called even in situations where a context switch didn't really > > > > + * happen even though it was requested. The caller uses it to indicate > > > > + * traversal of an RCU-tasks quiescent state. This is a macro rather than an > > > > + * inline function to avoid #include hell. > > > > > > I don't know. I just don't like the wording. It sounds too much like > > > it was written by someone that was confused for it being called when a > > > context switch didn't occur ;-) > > True :) > > > > > > > What about something more like: > > > > > > /* > > > * This is called to denote a RCU-task quiescent state. It is placed at > > > * voluntary preemption points, as RCU-task critical sections may not > > > * perform voluntary preemption or scheduling calls. It does not matter > > > * if the task is scheduled out or not, just that a voluntary preemption > > > * may be done. > > > */ > > > > s/RCU-task/RCU-tasks/ and I am good with this. > > Ok. I like Steve's comment better too. > > Btw, I see you just posted a change of the macro name from > rcu_note_voluntary_context_switch_lite to rcu_tasks_qs which actually in > itself is much more descriptive. Considering this, I feel the new name is > quite self-documenting in itself. So I am more inclined to drop this patch in > any series reposting, but let me know if you feel otherwise. I agree, but let's see what other people think. Thanx, Paul