* [PATCH v3 2/5] sched/deadline: make init_sched_dl_class() __init
[not found] <1433032021-11127-1-git-send-email-wanpeng.li@hotmail.com>
@ 2015-05-31 0:26 ` Wanpeng Li
2015-05-31 0:26 ` [PATCH v3 3/5] sched/deadline: reduce rq lock contention by eliminating locking of non-feasible target Wanpeng Li
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: Wanpeng Li @ 2015-05-31 0:26 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra; +Cc: Juri Lelli, linux-kernel, Wanpeng Li
It's a bootstrap function, make init_sched_dl_class() __init.
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
kernel/sched/deadline.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index f09f3ad..4303af2 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1686,7 +1686,7 @@ static void rq_offline_dl(struct rq *rq)
cpudl_clear_freecpu(&rq->rd->cpudl, rq->cpu);
}
-void init_sched_dl_class(void)
+void __init init_sched_dl_class(void)
{
unsigned int i;
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v3 3/5] sched/deadline: reduce rq lock contention by eliminating locking of non-feasible target
[not found] <1433032021-11127-1-git-send-email-wanpeng.li@hotmail.com>
2015-05-31 0:26 ` [PATCH v3 2/5] sched/deadline: make init_sched_dl_class() __init Wanpeng Li
@ 2015-05-31 0:26 ` Wanpeng Li
2015-05-31 0:27 ` [PATCH v3 4/5] sched/deadline: drop duplicate init_sched_dl_class declaration Wanpeng Li
2015-05-31 0:27 ` [PATCH v3 5/5] sched/core: remove superfluous resetting of dl_throttled flag Wanpeng Li
3 siblings, 0 replies; 4+ messages in thread
From: Wanpeng Li @ 2015-05-31 0:26 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra; +Cc: Juri Lelli, linux-kernel, Wanpeng Li
This patch adds check that prevents futile attempts to move dl tasks to
a CPU with active tasks of equal or earlier deadline. The same behavior as
commit 80e3d87b2c55 ("sched/rt: Reduce rq lock contention by eliminating
locking of non-feasible target") for rt class.
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
v1 -> v2:
* add check in find_lock_later_rq()
kernel/sched/deadline.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 4303af2..e49b1e6 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1012,7 +1012,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
(p->nr_cpus_allowed > 1)) {
int target = find_later_rq(p);
- if (target != -1)
+ if (target != -1 &&
+ dl_time_before(p->dl.deadline,
+ cpu_rq(target)->dl.earliest_dl.curr))
cpu = target;
}
rcu_read_unlock();
@@ -1360,6 +1362,17 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq)
later_rq = cpu_rq(cpu);
+ if (!dl_time_before(task->dl.deadline,
+ later_rq->dl.earliest_dl.curr)) {
+ /*
+ * Target rq has tasks of equal or earlier deadline,
+ * retrying does not release any lock and is unlikely
+ * to yield a different result.
+ */
+ later_rq = NULL;
+ break;
+ }
+
/* Retry if something changed. */
if (double_lock_balance(rq, later_rq)) {
if (unlikely(task_rq(task) != rq ||
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v3 4/5] sched/deadline: drop duplicate init_sched_dl_class declaration
[not found] <1433032021-11127-1-git-send-email-wanpeng.li@hotmail.com>
2015-05-31 0:26 ` [PATCH v3 2/5] sched/deadline: make init_sched_dl_class() __init Wanpeng Li
2015-05-31 0:26 ` [PATCH v3 3/5] sched/deadline: reduce rq lock contention by eliminating locking of non-feasible target Wanpeng Li
@ 2015-05-31 0:27 ` Wanpeng Li
2015-05-31 0:27 ` [PATCH v3 5/5] sched/core: remove superfluous resetting of dl_throttled flag Wanpeng Li
3 siblings, 0 replies; 4+ messages in thread
From: Wanpeng Li @ 2015-05-31 0:27 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra; +Cc: Juri Lelli, linux-kernel, Wanpeng Li
There are two init_sched_dl_class declarations, this patch drop
the duplicated one.
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
v1 -> v2:
* trim the changelog
kernel/sched/sched.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index d854555..d62b288 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1290,7 +1290,6 @@ extern void update_max_interval(void);
extern void init_sched_dl_class(void);
extern void init_sched_rt_class(void);
extern void init_sched_fair_class(void);
-extern void init_sched_dl_class(void);
extern void resched_curr(struct rq *rq);
extern void resched_cpu(int cpu);
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v3 5/5] sched/core: remove superfluous resetting of dl_throttled flag
[not found] <1433032021-11127-1-git-send-email-wanpeng.li@hotmail.com>
` (2 preceding siblings ...)
2015-05-31 0:27 ` [PATCH v3 4/5] sched/deadline: drop duplicate init_sched_dl_class declaration Wanpeng Li
@ 2015-05-31 0:27 ` Wanpeng Li
3 siblings, 0 replies; 4+ messages in thread
From: Wanpeng Li @ 2015-05-31 0:27 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra; +Cc: Juri Lelli, linux-kernel, Wanpeng Li
Resetting dl_throttled flag in rt_mutex_setprio (for a task that is going
to be boosted) is superfluous, as the natural place to do so is in
replenish_dl_entity(). If the task was on the runqueue and it is boosted
by a DL task, it will be enqueued back with ENQUEUE_REPLENISH flag set,
which can guarantee that dl_throttled is reset in replenish_dl_entity().
This patch drops the resetting of throttled status in function
rt_mutex_setprio().
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
v1 -> v2:
* rewrite patch subject and changelog
kernel/sched/core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5140db6..ef2ddd6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3076,7 +3076,6 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
if (!dl_prio(p->normal_prio) ||
(pi_task && dl_entity_preempt(&pi_task->dl, &p->dl))) {
p->dl.dl_boosted = 1;
- p->dl.dl_throttled = 0;
enqueue_flag = ENQUEUE_REPLENISH;
} else
p->dl.dl_boosted = 0;
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread