[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1416962647-76792-5-git-send-email-wanpeng.li@linux.intel.com>
Date: Wed, 26 Nov 2014 08:44:04 +0800
From: Wanpeng Li <wanpeng.li@...ux.intel.com>
To: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: Juri Lelli <juri.lelli@....com>,
Kirill Tkhai <ktkhai@...allels.com>,
linux-kernel@...r.kernel.org,
Wanpeng Li <wanpeng.li@...ux.intel.com>
Subject: [PATCH v6 4/7] sched/deadline: reduce overhead if there are no scheduling parameters changed
There is no need to dequeue/enqueue and push/pull if there are
no scheduling parameters changed for dl class, actually both
fair and rt class have already check if parameters changed for
them to avoid unnecessary overhead. This patch add the parameters
changed verify for dl class in order to reduce overhead.
Cc: Juri Lelli <juri.lelli@....com>
Signed-off-by: Wanpeng Li <wanpeng.li@...ux.intel.com>
---
v1 -> v2:
* cleanup alignment
* remove useless priority check
kernel/sched/core.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 981f075..837d2ea 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3402,6 +3402,20 @@ static bool check_same_owner(struct task_struct *p)
return match;
}
+static bool dl_param_changed(struct task_struct *p,
+ const struct sched_attr *attr)
+{
+ struct sched_dl_entity *dl_se = &p->dl;
+
+ if (dl_se->dl_runtime != attr->sched_runtime ||
+ dl_se->dl_deadline != attr->sched_deadline ||
+ dl_se->dl_period != attr->sched_period ||
+ dl_se->flags != attr->sched_flags)
+ return true;
+
+ return false;
+}
+
static int __sched_setscheduler(struct task_struct *p,
const struct sched_attr *attr,
bool user)
@@ -3530,7 +3544,7 @@ recheck:
goto change;
if (rt_policy(policy) && attr->sched_priority != p->rt_priority)
goto change;
- if (dl_policy(policy))
+ if (dl_policy(policy) && dl_param_changed(p, attr))
goto change;
p->sched_reset_on_fork = reset_on_fork;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists