Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754520AbbDUIVV (ORCPT ); Tue, 21 Apr 2015 04:21:21 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:51509 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056AbbDUIVR convert rfc822-to-8bit (ORCPT ); Tue, 21 Apr 2015 04:21:17 -0400 Message-ID: <553608B5.8030404@arm.com> Date: Tue, 21 Apr 2015 09:22:13 +0100 From: Juri Lelli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Wanpeng Li CC: Ingo Molnar , Peter Zijlstra , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 4/7] sched/deadline: reschedule if stop task slip in after pull operations References: <1428310399-13489-1-git-send-email-wanpeng.li@linux.intel.com> <1428310399-13489-4-git-send-email-wanpeng.li@linux.intel.com> <5534D48A.20304@arm.com> <20150420225901.GA7692@kernel> <20150420230234.GA7865@kernel> In-Reply-To: <20150420230234.GA7865@kernel> X-OriginalArrivalTime: 21 Apr 2015 08:21:15.0194 (UTC) FILETIME=[226069A0:01D07C0C] X-MC-Unique: lNsoaIlXSTmiYJZSMt_EZQ-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2542 Lines: 85 On 21/04/15 00:02, Wanpeng Li wrote: > On Tue, Apr 21, 2015 at 06:59:02AM +0800, Wanpeng Li wrote: >> Hi Juri, >> On Mon, Apr 20, 2015 at 11:27:22AM +0100, Juri Lelli wrote: >>> Hi, >>> >>> On 06/04/2015 09:53, Wanpeng Li wrote: >>>> pull_dl_task can drop (and re-acquire) rq->lock, this means a stop task >>>> can slip in, in which case we need to reschedule. This patch add the >>>> reschedule when the scenario occurs. >>>> >>> >>> Ok, I guess it can happen. Doesn't RT have the same problem? It seems that >>> it also has to deal with DL tasks slipping in, right? >> >> Yeah, I will send another patch to handle RT class in the v2 patchset. :) > > Oh, I just find I have already done them in patch 7/7. > Oh, right! That one ended up in another bucket. Sorry about that. Best, - Juri > Regards, > Wanpeng Li > >> >> Regards, >> Wanpeng Li >> >>> >>> Thanks, >>> >>> - Juri >>> >>>> Signed-off-by: Wanpeng Li >>>> --- >>>> kernel/sched/deadline.c | 16 +++++++++++++++- >>>> 1 file changed, 15 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c >>>> index b8b9355..844da0f 100644 >>>> --- a/kernel/sched/deadline.c >>>> +++ b/kernel/sched/deadline.c >>>> @@ -1739,7 +1739,13 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p) >>>> if (!task_on_rq_queued(p) || rq->dl.dl_nr_running) >>>> return; >>>> >>>> - if (pull_dl_task(rq)) >>>> + /* >>>> + * pull_dl_task() can drop (and re-acquire) rq->lock; this >>>> + * means a stop task can slip in, in which case we need to >>>> + * reschedule. >>>> + */ >>>> + if (pull_dl_task(rq) || >>>> + (rq->stop && task_on_rq_queued(rq->stop))) >>>> resched_curr(rq); >>>> } >>>> >>>> @@ -1786,6 +1792,14 @@ static void prio_changed_dl(struct rq *rq, struct task_struct *p, >>>> pull_dl_task(rq); >>>> >>>> /* >>>> + * pull_dl_task() can drop (and re-acquire) rq->lock; this >>>> + * means a stop task can slip in, in which case we need to >>>> + * reschedule. >>>> + */ >>>> + if (rq->stop && task_on_rq_queued(rq->stop)) >>>> + resched_curr(rq); >>>> + >>>> + /* >>>> * If we now have a earlier deadline task than p, >>>> * then reschedule, provided p is still on this >>>> * runqueue. >>>> > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/