From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753449AbbCZXTV (ORCPT ); Thu, 26 Mar 2015 19:19:21 -0400 Received: from mga03.intel.com ([134.134.136.65]:21398 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753355AbbCZXTU (ORCPT ); Thu, 26 Mar 2015 19:19:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,475,1422950400"; d="scan'208";a="698468859" Date: Fri, 27 Mar 2015 07:00:45 +0800 From: Wanpeng Li To: Juri Lelli Cc: Ingo Molnar , Peter Zijlstra , Wanpeng Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH v13] sched/deadline: support dl task migration during cpu hotplug Message-ID: <20150326230045.GA6271@kernel> Reply-To: Wanpeng Li References: <1427327243-10593-1-git-send-email-wanpeng.li@linux.intel.com> <5513EA1D.30208@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5513EA1D.30208@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Juri, On Thu, Mar 26, 2015 at 11:14:37AM +0000, Juri Lelli wrote: > >I think we could have better naming and the BUG_ON part could be >simplified. I'd propose something like this (sorry, it is based >on one of your previous versions.. I'm a bit struggling keeping >up with the pace ;)). Cool, thanks for your help, I will send a newer version later. ;) Regards, Wanpeng Li > >Thanks! > >--- > kernel/sched/deadline.c | 20 +++++++++----------- > 1 file changed, 9 insertions(+), 11 deletions(-) > >diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c >index 1820d1b..2b260a9 100644 >--- a/kernel/sched/deadline.c >+++ b/kernel/sched/deadline.c >@@ -518,7 +518,7 @@ static int start_dl_timer(struct sched_dl_entity *dl_se, bool boosted) > > static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq); > >-static void dl_task_migration(struct rq *rq, struct task_struct *p) >+static void dl_task_offline_migration(struct rq *rq, struct task_struct *p) > { > struct rq *later_rq = NULL; > bool fallback = false; >@@ -535,14 +535,12 @@ static void dl_task_migration(struct rq *rq, struct task_struct *p) > fallback = true; > cpu = cpumask_any_and(cpu_active_mask, tsk_cpus_allowed(p)); > if (cpu >= nr_cpu_ids) { >- if (dl_bandwidth_enabled()) { >- /* >- * Fail to find any suitable cpu. >- * The task will never come back! >- */ >- WARN_ON(1); >- return; >- } >+ /* >+ * Fail to find any suitable cpu. >+ * The task will never come back! >+ */ >+ BUG_ON(dl_bandwidth_enabled()); >+ > /* > * If admission control is disabled we > * try a little harder to let the task >@@ -609,11 +607,11 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) > update_rq_clock(rq); > > /* >- * So if we find that the rq the task was on is no longer >+ * If we find that the rq the task was on is no longer > * available, we need to select a new rq. > */ > if (unlikely(!rq->online)) { >- dl_task_migration(rq, p); >+ dl_task_offline_migration(rq, p); > goto unlock; > } > >-- >2.3.0