Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp995023imm; Fri, 11 May 2018 09:26:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoEiTYqv6Hm+SHVLuc5mq2QSff1elffihgYrhW+J1GCfWMilRfQfqpBPVrVaEWjt2XKopEd X-Received: by 2002:a62:d286:: with SMTP id c128-v6mr6184162pfg.240.1526055999297; Fri, 11 May 2018 09:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526055999; cv=none; d=google.com; s=arc-20160816; b=lwS0NIM4NV9jSKywXhtp/T4Yze0Ji72+fncSf4q1V+Hn3/E86l97WVEphd85/og5i6 askJ85CTtXQgfWerEDnGGNkTuV7AQsVrdIoqtYN9jtZrEyobzhsXPWlqYvOdM95W4W6S Z3AYBZw/KSkdxysfftOPuZ685CUWb1Da0k+X75D8Q1A0moFyff7aPZPf8TXS8YRR4Hyi vDuCFKJVBtzkwj+Bdu0MnTMSWvXKgXb/XNcmil9UorJnyEPQVynlob859s+SBt977T0o yOrv0pjXNvU4m0J3eCTiiTuEBCIv7JGQRcep+brm3/o65qd/qsqeEAznsOsDSw19hlen 1LMQ== 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=PNVDCdzk1MrF8BQLhpjzoprLMxLpHS4F6qRlrKHF4p8=; b=AxZHUcBkItGo8o5M+qJC6zCjEGhIXG0qP+o295cjQK95+rQzj8wnPVTseInYheVPbi cPnhLXtP/fpjL/kaS04Q1ES0pAMpi1HG0shDrdITNuzLLkvo7HGF+T6prWYA7pfeSuxh Xb0i9FrKkcecc8Yzc0GrILaUqX46r+vVv+XRAIRDHbK/KQvv0b73kZTjqOck/5sd11Q1 dQzU9fw02WP/tyZQUd5cbBbUa3Jl1d5r7JZ0sYgAUkkOr3+/aI4ItB0Z2ss5l6Kf3gU2 hoAUtL7mk0naaMwdawfwysvZS8WRjlNI2OfHu3GjGkGtEtCpNqa9ceYBvLAwmFs1j2FU 4QNw== 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 n125-v6si3603813pfn.352.2018.05.11.09.26.24; Fri, 11 May 2018 09:26:39 -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 S1752215AbeEKQZc (ORCPT + 99 others); Fri, 11 May 2018 12:25:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:44486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751398AbeEKQZb (ORCPT ); Fri, 11 May 2018 12:25:31 -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 5D0C32075C; Fri, 11 May 2018 16:25:30 +0000 (UTC) Date: Fri, 11 May 2018 12:25:28 -0400 From: Steven Rostedt To: "Paul E. McKenney" Cc: Byungchul Park , jiangshanlai@gmail.com, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org, kernel-team@lge.com, peterz@infradead.org Subject: Re: [PATCH] rcu: Report a quiescent state when it's exactly in the state Message-ID: <20180511122528.2a398d24@gandalf.local.home> In-Reply-To: <20180511122321.722a12cc@gandalf.local.home> References: <1526027434-21237-1-git-send-email-byungchul.park@lge.com> <3af4cec0-4019-e3ac-77f9-8631252fb6da@lge.com> <20180511161746.GX26088@linux.vnet.ibm.com> <20180511122321.722a12cc@gandalf.local.home> 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 Fri, 11 May 2018 12:23:21 -0400 Steven Rostedt wrote: > On Fri, 11 May 2018 09:17:46 -0700 > "Paul E. McKenney" wrote: > > > > >index ee8cf5fc..7432261 100644 > > > >--- a/include/linux/rcupdate.h > > > >+++ b/include/linux/rcupdate.h > > > >@@ -195,8 +195,8 @@ static inline void exit_tasks_rcu_finish(void) { } > > > > */ > > > > #define cond_resched_tasks_rcu_qs() \ > > > > do { \ > > > >- if (!cond_resched()) \ > > > >- rcu_note_voluntary_context_switch_lite(current); \ > > > >+ rcu_note_voluntary_context_switch_lite(current); \ > > > >+ cond_resched(); \ > > > > Ah, good point. > > > > Peter, I have to ask... Why is "cond_resched()" considered a preemption > > while "schedule()" is not? > > I would argue that cond_resched() not be considered a preemption. > Although, it may be called a "preemption point". A place that can be > preempted, but may not be. Maybe that's the answer. schedule() will > always schedule (even though it may pick the same task to run, but > not guaranteed to), where as, cond_resched() will only schedule if the > conditions are right. And maybe that's not really a "voluntary > schedule", although I think that can be argued against. > I would also say that one should never call schedule() directly without changing its state to something other than TASK_RUNNING. Hence, calling schedule directly is saying you are ready to sleep. But that is not the case with cond_resched() which should always be called with the state as TASK_RUNNING. -- Steve