10000 sched/fair: Remove rq's runnable avg · bsd-unix/linux@cd126af · GitHub
[go: up one dir, main page]

Skip to content

Commit cd126af

Browse files
ydu19Ingo Molnar
authored andcommitted
sched/fair: Remove rq's runnable avg
The current rq->avg is not used at all since its merge into the kernel, and the code is in the scheduler's hot path, so remove it. Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Signed-off-by: Yuyang Du <yuyang.du@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: arjan@linux.intel.com Cc: bsegall@google.com Cc: fengguang.wu@intel.com Cc: len.brown@intel.com Cc: morten.rasmussen@arm.com Cc: pjt@google.com Cc: rafael.j.wysocki@intel.com Cc: umgwanakikbuti@gmail.com Cc: vincent.guittot@linaro.org Link: http://lkml.kernel.org/r/1436918682-4971-2-git-send-email-yuyang.du@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent d308b9f commit cd126af

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

kernel/sched/debug.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,8 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group
6868
#define PN(F) \
6969
SEQ_printf(m, " .%-30s: %lld.%06ld\n", #F, SPLIT_NS((long long)F))
7070

71-
if (!se) {
72-
struct sched_avg *avg = &cpu_rq(cpu)->avg;
73-
P(avg->runnable_avg_sum);
74-
P(avg->avg_period);
71+
if (!se)
7572
return;
76-
}
77-
7873

7974
PN(se->exec_start);
8075
PN(se->vruntime);

kernel/sched/fair.c

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2724,19 +2724,12 @@ static inline void __update_group_entity_contrib(struct sched_entity *se)
27242724
}
27252725
}
27262726

2727-
static inline void update_rq_runnable_avg(struct rq *rq, int runnable)
2728-
{
2729-
__update_entity_runnable_avg(rq_clock_task(rq), cpu_of(rq), &rq->avg,
2730-
runnable, runnable);
2731-
__update_tg_runnable_avg(&rq->avg, &rq->cfs);
2732-
}
27332727
#else /* CONFIG_FAIR_GROUP_SCHED */
27342728
static inline void __update_cfs_rq_tg_load_contrib(struct cfs_rq *cfs_rq,
27352729
int force_update) {}
27362730
static inline void __update_tg_runnable_avg(struct sched_avg *sa,
27372731
struct cfs_rq *cfs_rq) {}
27382732
static inline void __update_group_entity_contrib(struct sched_entity *se) {}
2739-
static inline void update_rq_runnable_avg(struct rq *rq, int runnable) {}
27402733
#endif /* CONFIG_FAIR_GROUP_SCHED */
27412734

27422735
static inline void __update_task_entity_contrib(struct sched_entity *se)
@@ -2940,7 +2933,6 @@ static inline void dequeue_entity_load_avg(struct cfs_rq *cfs_rq,
29402933
*/
29412934
void idle_enter_fair(struct rq *this_rq)
29422935
{
2943-
update_rq_runnable_avg(this_rq, 1);
29442936
}
29452937

29462938
/*
@@ -2950,7 +2942,6 @@ void idle_enter_fair(struct rq *this_rq)
29502942
*/
29512943
void idle_exit_fair(struct rq *this_rq)
29522944
{
2953-
update_rq_runnable_avg(this_rq, 0);
29542945
}
29552946

29562947
static int idle_balance(struct rq *this_rq);
@@ -2959,7 +2950,6 @@ static int idle_balance(struct rq *this_rq);
29592950

29602951
static inline void update_entity_load_avg(struct sched_entity *se,
29612952
int update_cfs_rq) {}
2962-
static inline void update_rq_runnable_avg(struct rq *rq, int runnable) {}
29632953
static inline void enqueue_entity_load_avg(struct cfs_rq *cfs_rq,
29642954
struct sched_entity *se,
29652955
int wakeup) {}
@@ -4258,10 +4248,9 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
42584248
update_entity_load_avg(se, 1);
42594249
}
42604250

4261-
if (!se) {
4262-
update_rq_runnable_avg(rq, rq->nr_running);
4251+
if (!se)
42634252
add_nr_running(rq, 1);
4264-
}
4253+
42654254
hrtick_update(rq);
42664255
}
42674256

@@ -4319,10 +4308,9 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
43194308
update_entity_load_avg(se, 1);
43204309
}
43214310

4322-
if (!se) {
4311+
if (!se)
43234312
sub_nr_running(rq, 1);
4324-
update_rq_runnable_avg(rq, 1);
4325-
}
4313+
43264314
hrtick_update(rq);
43274315
}
43284316

@@ -6005,9 +5993,6 @@ static void __update_blocked_averages_cpu(struct task_group *tg, int cpu)
60055993
*/
60065994
if (!se->avg.runnable_avg_sum && !cfs_rq->nr_running)
60075995
list_del_leaf_cfs_rq(cfs_rq);
6008-
} else {
6009-
struct rq *rq = rq_of(cfs_rq);
6010-
update_rq_runnable_avg(rq, rq->nr_running);
60115996
}
60125997
}
60135998

@@ -7988,8 +7973,6 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
79887973

79897974
if (numabalancing_enabled)
79907975
task_tick_numa(rq, curr);
7991-
7992-
update_rq_runnable_avg(rq, 1);
79937976
}
79947977

79957978
/*

kernel/sched/sched.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,6 @@ struct rq {
595595
#ifdef CONFIG_FAIR_GROUP_SCHED
596596
/* list of leaf cfs_rq on this cpu: */
597597
struct list_head leaf_cfs_rq_list;
598-
599-
struct sched_avg avg;
600598
#endif /* CONFIG_FAIR_GROUP_SCHED */
601599

602600
/*

0 commit comments

Comments
 (0)
0