From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755836AbdDMAub (ORCPT ); Wed, 12 Apr 2017 20:50:31 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52254 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754785AbdDMAu3 (ORCPT ); Wed, 12 Apr 2017 20:50:29 -0400 Date: Wed, 12 Apr 2017 17:50:23 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Peter Zijlstra , LKML , Ingo Molnar , Andrew Morton , Thomas Gleixner Subject: Re: [PATCH v2] sched: Have do_idle() call __schedule() without enabling preemption Reply-To: paulmck@linux.vnet.ibm.com References: <20170412142744.6ff07236@gandalf.local.home> <20170412234859.GQ3956@linux.vnet.ibm.com> <20170412204000.3c6893eb@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170412204000.3c6893eb@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17041300-0056-0000-0000-0000033AB897 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006925; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00846747; UDB=6.00417694; IPR=6.00625184; BA=6.00005286; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015026; XFM=3.00000013; UTC=2017-04-13 00:50:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17041300-0057-0000-0000-00000770C234 Message-Id: <20170413005023.GT3956@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-12_19:,, 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-1702020001 definitions=main-1704130005 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 12, 2017 at 08:40:00PM -0400, Steven Rostedt wrote: > On Wed, 12 Apr 2017 16:48:59 -0700 > "Paul E. McKenney" wrote: > > > > I don't understand why schedule_idle() needs a loop given that > > schedule_preempt_disabled() doesn't have one, but other than > > But it does: > > void __sched schedule_preempt_disabled(void) > { > sched_preempt_enable_no_resched(); > schedule(); > preempt_disable(); > } > > Where we have: > > asmlinkage __visible void __sched schedule(void) > { > struct task_struct *tsk = current; > > sched_submit_work(tsk); > do { > preempt_disable(); > __schedule(false); > sched_preempt_enable_no_resched(); > } while (need_resched()); > } > > Which makes: > > void __sched schedule_preempt_disabled(void) > { > struct task_struct *tsk = current; > > scehdule_preempt_enable_no_resched(); > sched_submit_work(tsk); > do { > preempt_disable(); > __schedule(false); > schedule_preempt_enable_no_resched(); > } while (need_resched()); > preempt_disable(); > } > > My schedule_idle() is simply schedule_preempt_disabled() without the > change in preemption and no call to sched_submit_work(). Ah, thank you! > > that, for whatever it is worth, it looks good to me. > > Does this mean I can change the Cc: to Acked-by: ? Works for me! Acked-by: Paul E. McKenney > -- Steve > > > > > +void __sched schedule_idle(void) > > > +{ > > > + do { > > > + __schedule(false); > > > + } while (need_resched()); > > > +} > > > + >