Received: by 10.192.165.148 with SMTP id m20csp3376643imm; Mon, 23 Apr 2018 05:40:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/4LFBpZLK9BfquBLdojyMCuUMen0FHcvFM49rA/aMuv+VCW1ib4lF89zZkwbo/Mau6gMKu X-Received: by 10.98.189.14 with SMTP id a14mr19425036pff.30.1524487218615; Mon, 23 Apr 2018 05:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524487218; cv=none; d=google.com; s=arc-20160816; b=mpoGnj8l6FubHUKaFG1yFUF4zfEGHLa2LUKm3lzZ0IMouJ8KJNWVQPs2E2PC2M0Ib4 sqPT23P4uPr8/31v24UX2k0Ur2Ek/PhR6j2QXcc+GxHWOyOFt7vqmcxxR/NR6cZk4/Ju pNvc4blmziqQHv2iFlO1HmILfq3RjyWmBV3C/gEkwjgApaCfdLtmbpTU4E3NrGY0PSJP i/j0VIwgZ6Gh5EZzPNZ8sBlESORPawLgypmitvNp/LwneLVcYtaz4nJAlGnHf/n1xPge qzQrfvg/1YiPHChNyeBaeaVNcbE0Zm6eZztSpAznfc3NujtlDHx0oQQ1yuXVjsZl07vo Kxjw== 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=dFRcnb0dnznqaxH/SOSNrGZYujXo3ocKu8msUppw7OI=; b=04dY5JJ6ts3q1qQb9m6P3kV3GrUDt7M7rru6lcRpCDtDvzwRDxWcL0iMxhb89zt9oO wXl02yiAgEfukr+Pbukb7CvCKJx1VhSfOdqjp7ZajQ29cnAJsg4iNOf7JBi/0OwXcMH9 Q6XcnaSb0qIH3EMQbznB5Vq36AKjM+M2Z901d9hv3Yx3dhTmieyvMPD5j61NpZE/UPdH Mc1pTTHhNVWieu+6Gnk0R4D3xplv/XpMWt7CuSLsDzq+clH6LTLVQfw7qhsbzXcoK8mH dUdHjIoyp2NprlfsSNRaDKjJmpJq2krMasOZnTHvmkzT12Ily5AvFO1t1uQlcrM4utla qBtw== 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 f19si754338pgn.277.2018.04.23.05.40.03; Mon, 23 Apr 2018 05:40: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; 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 S1754900AbeDWMiy (ORCPT + 99 others); Mon, 23 Apr 2018 08:38:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43996 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754786AbeDWMiw (ORCPT ); Mon, 23 Apr 2018 08:38:52 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3NCZPuw039079 for ; Mon, 23 Apr 2018 08:38:51 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hhea4bdc9-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 23 Apr 2018 08:38:51 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Apr 2018 08:38:50 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 23 Apr 2018 08:38:46 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3NCck1x55378140; Mon, 23 Apr 2018 12:38:46 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CCCD6B204D; Mon, 23 Apr 2018 09:40:48 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.149.45]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 90C11B2046; Mon, 23 Apr 2018 09:40:48 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 138E116C8776; Mon, 23 Apr 2018 05:40:00 -0700 (PDT) Date: Mon, 23 Apr 2018 05:40:00 -0700 From: "Paul E. McKenney" To: Peter Zijlstra 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 Reply-To: paulmck@linux.vnet.ibm.com References: <20180423023150.GA21533@linux.vnet.ibm.com> <1524450747-22778-1-git-send-email-paulmck@linux.vnet.ibm.com> <20180423085127.GR4064@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180423085127.GR4064@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18042312-0048-0000-0000-00000261B03E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008905; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01022090; UDB=6.00521656; IPR=6.00801325; MB=3.00020724; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-23 12:38:50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042312-0049-0000-0000-000044E090D7 Message-Id: <20180423124000.GL26088@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-23_05:,, 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-1804230131 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 10:51:27AM +0200, Peter Zijlstra wrote: > 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? Because the TRACEPOINT_BENCHMARK tests are insane, so a similar level of insanity is required to make things work. Plus having this be unconditional would not be good for performance, as 0day has been telling me frequently over the past couple of years. All that aside, I am very open to ideas. What would you suggest? Thanx, Paul > > 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 > > >