From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756175AbbE2Oec (ORCPT ); Fri, 29 May 2015 10:34:32 -0400 Received: from casper.infradead.org ([85.118.1.10]:37165 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206AbbE2OeY (ORCPT ); Fri, 29 May 2015 10:34:24 -0400 Date: Fri, 29 May 2015 16:34:20 +0200 From: Peter Zijlstra To: Wanpeng Li Cc: Ingo Molnar , Juri Lelli , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 7/7] sched/rt: reschedule if stop/dl task slip in after pull operations Message-ID: <20150529143420.GR3644@twins.programming.kicks-ass.net> References: <1431496867-4194-1-git-send-email-wanpeng.li@linux.intel.com> <1431496867-4194-7-git-send-email-wanpeng.li@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431496867-4194-7-git-send-email-wanpeng.li@linux.intel.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 13, 2015 at 02:01:07PM +0800, Wanpeng Li wrote: > pull_rt_task() can drop (and re-acquire) rq->lock, this means a dl > or stop task can slip in, in which case need to reschedule. This > patch add the reschedule when the scenario occurs. > > Signed-off-by: Wanpeng Li > --- > kernel/sched/rt.c | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c > index 560d2fa..8c948bf 100644 > --- a/kernel/sched/rt.c > +++ b/kernel/sched/rt.c > @@ -2136,7 +2136,14 @@ static void switched_from_rt(struct rq *rq, struct task_struct *p) > if (!task_on_rq_queued(p) || rq->rt.rt_nr_running) > return; > > - if (pull_rt_task(rq)) > + /* > + * pull_rt_task() can drop (and re-acquire) rq->lock; this > + * means a dl or stop task can slip in, in which case we need > + * to reschedule. > + */ > + if (pull_rt_task(rq) || > + (unlikely((rq->stop && task_on_rq_queued(rq->stop)) || > + rq->dl.dl_nr_running))) > resched_curr(rq); > } Same as before; why is the normal wakeup preemption check not working?