Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4611890imm; Mon, 14 May 2018 09:58:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo+1kxpstCm62/jHC4A9IMLVWevlzk5w1chJXNZqR0dzguxbXdLwWDk1Jza9vHvFfZZxtsM X-Received: by 2002:a62:de02:: with SMTP id h2-v6mr11295374pfg.205.1526317137759; Mon, 14 May 2018 09:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526317137; cv=none; d=google.com; s=arc-20160816; b=0p9tRZjiAZr3jn6uxkdAEMg2l+AuxRbTmT6URoyV2/pW9STk4fpCqX5hlfkY6yrUq0 km7xiLEX+w6KcN1PhmEcV84osdie6XJpbNP9Ui0SFELl9k6eNLUyZCPh6J63wcjkT2iW eHSb3c85ToHlsIpkPBy1A40VKrOca3nZ3csKvo57aABWfBTckfq6mqsJGDshU5foOMk2 tISiiMIbk6nNNLUODe+Y7EMDhUdHfCxYIKJMNbh98OKbit3mmRmM/sPU6Prg3qZ6Uke9 2Rhc68UVAO2CmjoB7GYxq3vAubrvuFIdtW5ZUNTL3iIl8pgwYmJUqZKFLM+krr+Q4lK3 rsuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=gTjMwaQE2Cn0tf+7dti7Nzzy5nH59/F44xvA5NH1YEE=; b=W6kzrkNE4MoVLRUslfHR9txuvD0M8J1bcOTNHMtfH9eLU3B5Ud45p5ZXkZCvsm63/5 X2YSqDM8q3R3HaPBMA6Ea0v2OEcUaEhGbpVt2SsrJLl8aP08oWNYlbY9BrIi9cpQYEh6 WWqh7mE6MNbtPh5awbXQw9pyANX05pg7+7/u6QVNX0iek3b0usJh4NrREKov+Ver1V7P EwHyx8W3VnwoAVKoC3yIw7PNPOm8YDKQjyF733kqLmQySxLA5Jd6E5awWEn6rfliLO8s FukM5mfnv4V6Rv9abw0fqpIaieWzce6TOgb1vNdHW0uNyVm0o9sshN5SFEjDXVFZvreM hPNQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c196-v6si7824717pga.494.2018.05.14.09.58.42; Mon, 14 May 2018 09:58:57 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754088AbeENOzB (ORCPT + 99 others); Mon, 14 May 2018 10:55:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:53504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498AbeENOy5 (ORCPT ); Mon, 14 May 2018 10:54:57 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 92EA121738; Mon, 14 May 2018 14:54:56 +0000 (UTC) Date: Mon, 14 May 2018 10:54:54 -0400 From: Steven Rostedt To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, "Paul E. McKenney" , 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 Message-ID: <20180514105454.45946ad3@gandalf.local.home> In-Reply-To: <20180514031541.67247-3-joel@joelfernandes.org> References: <20180514031541.67247-1-joel@joelfernandes.org> <20180514031541.67247-3-joel@joelfernandes.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ;-) 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. */ > */ > #ifdef CONFIG_TASKS_RCU > #define rcu_note_voluntary_context_switch_lite(t) \ > @@ -187,7 +191,8 @@ static inline void exit_tasks_rcu_finish(void) { } > #endif /* #else #ifdef CONFIG_TASKS_RCU */ > > /** > - * cond_resched_tasks_rcu_qs - Report potential quiescent states to RCU > + * cond_resched_tasks_rcu_qs - Report potential quiescent states to RCU. > + * The quiescent state report is made even if cond_resched() did nothing. Same thing here. * The quiescent state report does not depend on cond_resched() scheduling. -- Steve > * > * This macro resembles cond_resched(), except that it is defined to > * report potential quiescent states to RCU-tasks even if the cond_resched()