From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbdJEPLW (ORCPT ); Thu, 5 Oct 2017 11:11:22 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34186 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751489AbdJEPLT (ORCPT ); Thu, 5 Oct 2017 11:11:19 -0400 Date: Thu, 5 Oct 2017 08:11:12 -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 Subject: Re: [PATCH tip/core/rcu 1/4] sched,rcu: Make cond_resched() provide RCU quiescent state Reply-To: paulmck@linux.vnet.ibm.com References: <20171004215006.GA12792@linux.vnet.ibm.com> <1507153825-14136-1-git-send-email-paulmck@linux.vnet.ibm.com> <20171005104051.shazuwnqbqjj3be2@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171005104051.shazuwnqbqjj3be2@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17100515-0056-0000-0000-000003D4533C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007847; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000235; SDB=6.00926854; UDB=6.00466313; IPR=6.00707095; BA=6.00005623; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017407; XFM=3.00000015; UTC=2017-10-05 15:11:16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17100515-0057-0000-0000-0000080B63BD Message-Id: <20171005151112.GR3521@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-05_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710050213 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 05, 2017 at 12:40:51PM +0200, Peter Zijlstra wrote: > On Wed, Oct 04, 2017 at 02:50:22PM -0700, Paul E. McKenney wrote: > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > index 26a7df4e558c..59688ef3ea23 100644 > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1565,10 +1565,11 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) > > * cond_resched_lock() will drop the spinlock before scheduling, > > * cond_resched_softirq() will enable bhs before scheduling. > > */ > > +void rcu_all_qs(void); > > #ifndef CONFIG_PREEMPT > > extern int _cond_resched(void); > > #else > > -static inline int _cond_resched(void) { return 0; } > > +static inline int _cond_resched(void) { rcu_all_qs(); return 0; } > > #endif > > Why does it need to change PREEMPT? the whole cond_resched() thing > should be a no-op on PREEMPT. Let's see... Clearly for RCU-preempt, there is no need. And you are quite right, if rcu_read_lock_bh() or rcu_read_lock_sched() are preventing a CPU from context switching, invoking cond_resched() on that CPU would be a bug anyway. I will drop this hunk, thank you! Thanx, Paul