From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751070AbdAPLiN (ORCPT ); Mon, 16 Jan 2017 06:38:13 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58812 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750817AbdAPLiL (ORCPT ); Mon, 16 Jan 2017 06:38:11 -0500 Date: Mon, 16 Jan 2017 03:38:02 -0800 From: "Paul E. McKenney" To: Josh Triplett Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH tip/core/rcu 11/20] sched,rcu: Make cond_resched() provide RCU quiescent state Reply-To: paulmck@linux.vnet.ibm.com References: <20170114091255.GA20854@linux.vnet.ibm.com> <1484385201-22227-11-git-send-email-paulmck@linux.vnet.ibm.com> <20170116080842.3hj3j4632vgec63f@x> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170116080842.3hj3j4632vgec63f@x> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17011611-0008-0000-0000-000006EBF481 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006443; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00808336; UDB=6.00393663; IPR=6.00585695; BA=6.00005059; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013934; XFM=3.00000011; UTC=2017-01-16 11:38:08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17011611-0009-0000-0000-00003F061F5D Message-Id: <20170116113802.GN5238@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-16_10:,, 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-1612050000 definitions=main-1701160176 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 16, 2017 at 12:08:43AM -0800, Josh Triplett wrote: > On Sat, Jan 14, 2017 at 01:13:12AM -0800, Paul E. McKenney wrote: > > There is some confusion as to which of cond_resched() or > > cond_resched_rcu_qs() should be added to long in-kernel loops. > > This commit therefore eliminates the decision by adding RCU > > quiescent states to cond_resched(). > > > > Warning: This is a prototype. For example, it does not correctly > > handle Tasks RCU. Which is OK for the moment, given that no one > > actually uses Tasks RCU yet. > > > > Reported-by: Michal Hocko > > Not-yet-signed-off-by: Paul E. McKenney > > Cc: Peter Zijlstra > > Do you intend to merge this patch, or have you just posted it for > review? > > You may want to remove it from this 20-patch series and post it as a > separate RFC PATCH, to ensure that it doesn't get merged while still a > prototype. It does look like I should delay this one until I get my story straight. Good catch! Thanx, Paul > > include/linux/sched.h | 3 ++- > > kernel/sched/core.c | 1 + > > 2 files changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > index 4d1905245c7a..1531c48f56e2 100644 > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -3352,10 +3352,11 @@ static inline int signal_pending_state(long state, struct task_struct *p) > > * 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 > > > > #define cond_resched() ({ \ > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index c56fb57f2991..b442f8918eb9 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -4907,6 +4907,7 @@ int __sched _cond_resched(void) > > preempt_schedule_common(); > > return 1; > > } > > + rcu_all_qs(); > > return 0; > > } > > EXPORT_SYMBOL(_cond_resched); > > -- > > 2.5.2 > > >