Received: by 10.192.165.148 with SMTP id m20csp3179371imm; Mon, 23 Apr 2018 01:53:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/3o39P4X3JNBYJ+Fs5AKEI39EjPLCYQPYhPj11P+l4blNNTdqgqfu0EheDyqcYuglMFtAi X-Received: by 2002:a17:902:a985:: with SMTP id bh5-v6mr20443046plb.0.1524473598215; Mon, 23 Apr 2018 01:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524473598; cv=none; d=google.com; s=arc-20160816; b=0N5elqW89YIOfI88wqhLHHOOO9NHE6RkPNo1rjkf4iUAFcJV5jhRn9WjH36FKfos3Z C7R4qqLwJf9mIiKZQJfZGnTFo7tLuLKMCKDYTkgHrfKxA65kFdsdMpHNGytwUGsauGtc 2HxF7wrvtDNnmGYU0GzVtlR1WIlS+8iPmoPlYUtaddknX3l0AcGoa5VoEbr5GuxaOPPU UzkRSdW5lgjP5eBwKNtp9XchaHRMlVA8GL1zqx2XtSnW0ddIBtElO2Dj0UKQBAb4tTqI sv6nMYm6K7uBBO6EW6TF8gSGj+x4U7h2wJ6c4cZ4BQBzf7Gr77FanzhCB4c4MMjTfhUV Ojyw== 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=3J++VJh/0pm9zXU2YhWANBm3NRH+anaINwGC8EitaXg=; b=eeaJ6IF98KpBAR73JzESNAJ9n4aeZ7jx5ykaGFWHNZuxBkpdywY2xUqss4+PdwP0ct zk0vQG97kbfdJbG/O4cO3zA/OElqULhE2GR54eUp5aWd7VE+6woJgN110g7bGM2IankT SvKhZ94ao7LUp6WXhiQhIK6HhngKfi3KajQyMbrusoF00MHZ4Sxz4a2WydX3USt91CFr w3/INkWx8sdl9JtbCHBYV0GrGPQ8sL/EP5mnzC+pkciHBmHftiH902Qk4Wa9fWBf07BZ LpMNHDRMLTwvlFUC8YLSd64scRfpDGLK8wO3OFtbxaPj+As+Hqq3d30Y5xdK3bM0tPQM CJTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Nvl4vhJZ; 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 f3-v6si11356899pld.513.2018.04.23.01.53.04; Mon, 23 Apr 2018 01:53:18 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Nvl4vhJZ; 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 S1754356AbeDWIvw (ORCPT + 99 others); Mon, 23 Apr 2018 04:51:52 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:60160 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754029AbeDWIvq (ORCPT ); Mon, 23 Apr 2018 04:51:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3J++VJh/0pm9zXU2YhWANBm3NRH+anaINwGC8EitaXg=; b=Nvl4vhJZl8vpkwClaoElZSfFD K2InHPGWpXm2hDrhV5j+yAa481yq85LQRy+uju3qWxLBmeOC3V28zjzJmh+mzhoUKA2BH4+9MOUge d9xDBtNM4mi3A2ce7Ex5D0YMaWSLOZI0PyG6r4skVKxVPBWF9mVAlitYKhx3CiluIDD7pZmSMsKkF 5iXICaO16Z4cePvefHK637Zc5GWIF/s0Sz/Hn5Nn4soS5fmfeS442/BvQr7ULies5JHCb7i0Ba7j9 qzuy/nk78RT13sPdagZmnBgm1dcwtUbuZCpgTVOKCSz+ELyB81DmtSwJqmllnpcQ5OhsvnYya8zXR mDIJtCQ1A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fAXC6-0006bZ-1w; Mon, 23 Apr 2018 08:51:30 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 72DBA2029F877; Mon, 23 Apr 2018 10:51:27 +0200 (CEST) Date: Mon, 23 Apr 2018 10:51:27 +0200 From: Peter Zijlstra To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel.opensrc@gmail.com Subject: Re: [PATCH tip/core/rcu 01/22] sched: Make non-production PREEMPT cond_resched() help Tasks RCU Message-ID: <20180423085127.GR4064@hirez.programming.kicks-ass.net> References: <20180423023150.GA21533@linux.vnet.ibm.com> <1524450747-22778-1-git-send-email-paulmck@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524450747-22778-1-git-send-email-paulmck@linux.vnet.ibm.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 22, 2018 at 07:32:06PM -0700, Paul E. McKenney wrote: > In CONFIG_PREEMPT=y kernels, cond_resched() is a complete no-op, and > thus cannot help advance Tasks-RCU grace periods. However, such grace > periods are only an issue in non-production benchmarking runs of the > Linux kernel. This commit therefore makes cond_resched() invoke > rcu_note_voluntary_context_switch() for kernels implementing Tasks RCU > even in CONFIG_PREEMPT=y kernels. I'm confused.. why is having this conditional on TRACEPOINT_BENCHMARK a sane idea? > > Reported-by: Steven Rostedt > Signed-off-by: Paul E. McKenney > --- > include/linux/sched.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index b3d697f3b573..fe8f7178a22d 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -1617,6 +1617,12 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) > */ > #ifndef CONFIG_PREEMPT > extern int _cond_resched(void); > +#elif defined(CONFIG_TRACEPOINT_BENCHMARK) > +static inline int _cond_resched(void) > +{ > + rcu_note_voluntary_context_switch(current); > + return 0; > +} > #else > static inline int _cond_resched(void) { return 0; } > #endif > -- > 2.5.2 >