sched/rt: Move cpu rq properties from "struct rt_rq" to "struct rq"
PATCH 1/1 sched/rt: Move cpu rq properties from "struct rt_rq" to "struct rq"
The members rt_nr_total, rt_nr_migratory, overloaded and pushable_tasks are properties of cpu runqueue, not group rt_rq.
--- kernel/sched/core.c | 5 ++++ kernel/sched/rt.c | 67 +++++++++++++++++++++++++------------------------- kernel/sched/sched.h | 11 ++++----- 3 files changed, 44 insertions(+), 39 deletions(-)
kernel/sched/core.c +5 -0
@@ -6938,6 +6938,11 @@ void __init sched_init(void)INIT_LIST_HEAD (&rq->cfs_tasks); + rq->rt_nr_total =0 ; + rq->rt_nr_migratory =0 ; + rq->rt_overloaded =0 ; +plist_head_init (&rq->pushable_tasks); +rq_attach_root (rq, &def_root_domain);#ifdef CONFIG_NO_HZ rq->nohz_flags =0 ;
kernel/sched/rt.c +34 -33
166 lines not on this page · raw message
kernel/sched/sched.h +5 -6
@@ -301,12 +301,6 @@ struct rt_rq { #endif } highest_prio;#endif -#ifdef CONFIG_SMP -unsigned long rt_nr_migratory; -unsigned long rt_nr_total; -int overloaded; -struct plist_head pushable_tasks; -#endif int rt_throttled;u64 rt_time;u64 rt_runtime;
@@ -431,6 +425,11 @@ struct rq {struct list_head cfs_tasks; +unsigned long rt_nr_total; +unsigned long rt_nr_migratory; +int rt_overloaded; +struct plist_head pushable_tasks; +u64 rt_avg;u64 age_stamp;u64 idle_stamp;
Quoted 2 lines · Kirill Tkhai
The members
rt_nr_total,rt_nr_migratory, overloaded andpushable_tasksare properties of cpu runqueue, not grouprt_rq.
Why?
Thanks,
tglx
20.12.2012, 21:53, "Thomas Gleixner" <[email protected]>:
Quoted 6 lines · Kirill Tkhai
Quoted 3 lines
The members
rt_nr_total,rt_nr_migratory, overloaded andpushable_tasksare properties of cpu runqueue, not grouprt_rq.Why?
Because, they depend on number and properties of all processes of rq, not of nested rt_rq.
Quoted 4 lines
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Steven Rostedt
reviewerQuoted 10 lines · Kirill Tkhai
20.12.2012, 21:53, "Thomas Gleixner" <[email protected]>:
Quoted 6 lines · Kirill Tkhai
Quoted 3 lines
The members
rt_nr_total,rt_nr_migratory, overloaded andpushable_tasksare properties of cpu runqueue, not grouprt_rq.Why?
Because, they depend on number and properties of all processes of rq, not of nested
rt_rq.
You're answer is still confusing.
struct rq {
[...]
struct rt_rq rt;rt_rq is just a part of rq. What's the point?
rq = container_of(rt_rq, struct rt_rq, rt);
As the comment above struct rt_rq says:
/* Real-Time classes' related field in a runqueue: */
Those look like fields related to the Real-Time class. I don't see them used outside of kernel/sched/rt.c
-- Steve
Quoted 4 lines
Quoted 4 lines
Thanks,
tglx
21.12.2012, 03:07, "Steven Rostedt" <[email protected]>:
Quoted 17 lines · Kirill Tkhai
Quoted 7 lines
20.12.2012, 21:53, "Thomas Gleixner" <[email protected]>:
Quoted 4 lines · Kirill Tkhai
Quoted 2 lines
The members
rt_nr_total,rt_nr_migratory, overloaded andpushable_tasksare properties of cpu runqueue, not grouprt_rq.Why?
Because, they depend on number and properties of all processes of rq, not of nested
rt_rq.You're answer is still confusing.
struct rq {
[...]
structrt_rqrt;
rt_rqis just a part of rq. What's the point?
Quoted 9 lines
rq =
container_of(rt_rq, struct rt_rq, rt);As the comment above struct
rt_rqsays:/* Real-Time classes' related field in a runqueue: */
Those look like fields related to the Real-Time class. I don't see them used outside of
kernel/sched/rt.c
entity_1->my_q_1
/
/
rq->rt -entity_2->my_q_2
\
\
entity_n->my_q_nI say about child rt_rqs (my_q_1....my_q_n). They don't have rt_nr_total, rt_nr_migratory, overloaded and pushable_tasks. The only use of overloaded, for example, is "rq->rt.overloaded". The same with other variables.
Kirill
Quoted 5 lines
-- Steve
Quoted 3 lines
Quoted 3 lines
Thanks,
tglx
Steven Rostedt
reviewerQuoted 11 lines · Kirill Tkhai
entity_1->my_q_1
/
/
rq->rt -entity_2->my_q_2
\
\
entity_n->my_q_nQuoted 2 lines
I say about child
rt_rqs(my_q_1....my_q_n). They don't havert_nr_total,rt_nr_migratory, overloaded andpushable_tasks. The only use of overloaded, for example, is "rq->rt.overloaded". The same with other variables.
You're missing the point. rt_rq is not just for entities, it's the encapsulation of the rt class.
Now if you want to encapsulate the rt sched group, then you could add a new struct and put that into the rt_rq struct and use that for all the group functions. But please don't just cludder the rq struct with rt specific data. The rt_rq was created as a container for the rt class.
-- Steve
Steven Rostedt
reviewerQuoted 3 lines · Steven Rostedt
Now if you want to encapsulate the rt sched group, then you could add a new struct and put that into the
rt_rqstruct and use that for all the group functions. But please don't just cludder the rq struct with rt
cludder? I must have a studder, as it is suppose to be clutter and stutter!
;-)
-- Steve
Quoted 4 lines
specific data. The
rt_rqwas created as a container for the rt class.-- Steve