While trying to improve the Deadline sched class behaviour for
asymmetric CPU capacity systems I came across some possible
cleanups for DL (and RT).
Overview:
[PATCH 1/6] - Remove `struct dl_bandwidth def_dl_bandwidth`.
[PATCH 2/6] - Move functions into DL sched class which don't have to
be exported.
[PATCH 3/6] - Merge two DL admission control functions which provide
very similar functionality.
[PATCH 4/6] - Use DL rb_entry() macros and cached rbtree wrapper
`rb_first_cached()` consistently.
[PATCH 5/6] - Remove unused !CONFIG_SMP function definitions in DL/RT.
[PATCH 6/6] - Remove redundant function parameter in DL/RT.
Dietmar Eggemann (6):
sched/deadline: Remove unused def_dl_bandwidth
sched/deadline: Move bandwidth mgmt and reclaim functions into sched
class source file
sched/deadline: Merge dl_task_can_attach() and dl_cpu_busy()
sched/deadline: Use __node_2_[pdl|dle]() and rb_first_cached()
consistently
sched/deadline,rt: Remove unused functions for !CONFIG_SMP
sched/deadline,rt: Remove unused parameter from
pick_next_[rt|dl]_entity()
kernel/sched/core.c | 14 ++--
kernel/sched/deadline.c | 141 ++++++++++++++++++++--------------------
kernel/sched/rt.c | 16 +----
kernel/sched/sched.h | 53 +--------------
4 files changed, 84 insertions(+), 140 deletions(-)
--
2.25.1
The `struct rq *rq` parameter isn't used. Remove it.
Signed-off-by: Dietmar Eggemann <[email protected]>
---
kernel/sched/deadline.c | 5 ++---
kernel/sched/rt.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 93fcef57dd59..11cdc6d0c45f 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1961,8 +1961,7 @@ static void set_next_task_dl(struct rq *rq, struct task_struct *p, bool first)
deadline_queue_push_tasks(rq);
}
-static struct sched_dl_entity *pick_next_dl_entity(struct rq *rq,
- struct dl_rq *dl_rq)
+static struct sched_dl_entity *pick_next_dl_entity(struct dl_rq *dl_rq)
{
struct rb_node *left = rb_first_cached(&dl_rq->root);
@@ -1981,7 +1980,7 @@ static struct task_struct *pick_task_dl(struct rq *rq)
if (!sched_dl_runnable(rq))
return NULL;
- dl_se = pick_next_dl_entity(rq, dl_rq);
+ dl_se = pick_next_dl_entity(dl_rq);
BUG_ON(!dl_se);
p = dl_task_of(dl_se);
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index b62e7652464b..67039e5d359b 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1719,8 +1719,7 @@ static inline void set_next_task_rt(struct rq *rq, struct task_struct *p, bool f
rt_queue_push_tasks(rq);
}
-static struct sched_rt_entity *pick_next_rt_entity(struct rq *rq,
- struct rt_rq *rt_rq)
+static struct sched_rt_entity *pick_next_rt_entity(struct rt_rq *rt_rq)
{
struct rt_prio_array *array = &rt_rq->active;
struct sched_rt_entity *next = NULL;
@@ -1742,7 +1741,7 @@ static struct task_struct *_pick_next_task_rt(struct rq *rq)
struct rt_rq *rt_rq = &rq->rt;
do {
- rt_se = pick_next_rt_entity(rq, rt_rq);
+ rt_se = pick_next_rt_entity(rt_rq);
BUG_ON(!rt_se);
rt_rq = group_rt_rq(rt_se);
} while (rt_rq);
--
2.25.1
Hi,
On 02/03/22 19:34, Dietmar Eggemann wrote:
> While trying to improve the Deadline sched class behaviour for
> asymmetric CPU capacity systems I came across some possible
> cleanups for DL (and RT).
>
> Overview:
>
> [PATCH 1/6] - Remove `struct dl_bandwidth def_dl_bandwidth`.
>
> [PATCH 2/6] - Move functions into DL sched class which don't have to
> be exported.
>
> [PATCH 3/6] - Merge two DL admission control functions which provide
> very similar functionality.
>
> [PATCH 4/6] - Use DL rb_entry() macros and cached rbtree wrapper
> `rb_first_cached()` consistently.
>
> [PATCH 5/6] - Remove unused !CONFIG_SMP function definitions in DL/RT.
>
> [PATCH 6/6] - Remove redundant function parameter in DL/RT.
>
> Dietmar Eggemann (6):
> sched/deadline: Remove unused def_dl_bandwidth
> sched/deadline: Move bandwidth mgmt and reclaim functions into sched
> class source file
> sched/deadline: Merge dl_task_can_attach() and dl_cpu_busy()
> sched/deadline: Use __node_2_[pdl|dle]() and rb_first_cached()
> consistently
> sched/deadline,rt: Remove unused functions for !CONFIG_SMP
> sched/deadline,rt: Remove unused parameter from
> pick_next_[rt|dl]_entity()
>
> kernel/sched/core.c | 14 ++--
> kernel/sched/deadline.c | 141 ++++++++++++++++++++--------------------
> kernel/sched/rt.c | 16 +----
> kernel/sched/sched.h | 53 +--------------
> 4 files changed, 84 insertions(+), 140 deletions(-)
These look ok to me. Thanks for the cleanups!
Acked-by: Juri Lelli <[email protected]>
Best,
Juri
On Fri, Mar 04, 2022 at 10:21:49AM +0100, Juri Lelli wrote:
> Hi,
>
> On 02/03/22 19:34, Dietmar Eggemann wrote:
> > While trying to improve the Deadline sched class behaviour for
> > asymmetric CPU capacity systems I came across some possible
> > cleanups for DL (and RT).
> >
> > Overview:
> >
> > [PATCH 1/6] - Remove `struct dl_bandwidth def_dl_bandwidth`.
> >
> > [PATCH 2/6] - Move functions into DL sched class which don't have to
> > be exported.
> >
> > [PATCH 3/6] - Merge two DL admission control functions which provide
> > very similar functionality.
> >
> > [PATCH 4/6] - Use DL rb_entry() macros and cached rbtree wrapper
> > `rb_first_cached()` consistently.
> >
> > [PATCH 5/6] - Remove unused !CONFIG_SMP function definitions in DL/RT.
> >
> > [PATCH 6/6] - Remove redundant function parameter in DL/RT.
> >
> > Dietmar Eggemann (6):
> > sched/deadline: Remove unused def_dl_bandwidth
> > sched/deadline: Move bandwidth mgmt and reclaim functions into sched
> > class source file
> > sched/deadline: Merge dl_task_can_attach() and dl_cpu_busy()
> > sched/deadline: Use __node_2_[pdl|dle]() and rb_first_cached()
> > consistently
> > sched/deadline,rt: Remove unused functions for !CONFIG_SMP
> > sched/deadline,rt: Remove unused parameter from
> > pick_next_[rt|dl]_entity()
> >
> > kernel/sched/core.c | 14 ++--
> > kernel/sched/deadline.c | 141 ++++++++++++++++++++--------------------
> > kernel/sched/rt.c | 16 +----
> > kernel/sched/sched.h | 53 +--------------
> > 4 files changed, 84 insertions(+), 140 deletions(-)
>
> These look ok to me. Thanks for the cleanups!
>
> Acked-by: Juri Lelli <[email protected]>
Thanks!
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 821aecd09e5ad2f8d4c3d8195333d272b392f7d3
Gitweb: https://git.kernel.org/tip/821aecd09e5ad2f8d4c3d8195333d272b392f7d3
Author: Dietmar Eggemann <[email protected]>
AuthorDate: Wed, 02 Mar 2022 19:34:33 +01:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Tue, 08 Mar 2022 16:08:40 +01:00
sched/deadline,rt: Remove unused parameter from pick_next_[rt|dl]_entity()
The `struct rq *rq` parameter isn't used. Remove it.
Signed-off-by: Dietmar Eggemann <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Juri Lelli <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
kernel/sched/deadline.c | 5 ++---
kernel/sched/rt.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 93fcef5..11cdc6d 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1961,8 +1961,7 @@ static void set_next_task_dl(struct rq *rq, struct task_struct *p, bool first)
deadline_queue_push_tasks(rq);
}
-static struct sched_dl_entity *pick_next_dl_entity(struct rq *rq,
- struct dl_rq *dl_rq)
+static struct sched_dl_entity *pick_next_dl_entity(struct dl_rq *dl_rq)
{
struct rb_node *left = rb_first_cached(&dl_rq->root);
@@ -1981,7 +1980,7 @@ static struct task_struct *pick_task_dl(struct rq *rq)
if (!sched_dl_runnable(rq))
return NULL;
- dl_se = pick_next_dl_entity(rq, dl_rq);
+ dl_se = pick_next_dl_entity(dl_rq);
BUG_ON(!dl_se);
p = dl_task_of(dl_se);
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index b62e765..67039e5 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1719,8 +1719,7 @@ static inline void set_next_task_rt(struct rq *rq, struct task_struct *p, bool f
rt_queue_push_tasks(rq);
}
-static struct sched_rt_entity *pick_next_rt_entity(struct rq *rq,
- struct rt_rq *rt_rq)
+static struct sched_rt_entity *pick_next_rt_entity(struct rt_rq *rt_rq)
{
struct rt_prio_array *array = &rt_rq->active;
struct sched_rt_entity *next = NULL;
@@ -1742,7 +1741,7 @@ static struct task_struct *_pick_next_task_rt(struct rq *rq)
struct rt_rq *rt_rq = &rq->rt;
do {
- rt_se = pick_next_rt_entity(rq, rt_rq);
+ rt_se = pick_next_rt_entity(rt_rq);
BUG_ON(!rt_se);
rt_rq = group_rt_rq(rt_se);
} while (rt_rq);