Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit630246a

Browse files
Quentin PerretIngo Molnar
Quentin Perret
authored and
Ingo Molnar
committed
sched/fair: Clean-up update_sg_lb_stats parameters
In preparation for the introduction of a new root domain flag which canbe set during load balance (the 'overutilized' flag), clean-up the setof parameters passed to update_sg_lb_stats(). More specifically, the'local_group' and 'local_idx' parameters can be removed since they caneasily be reconstructed from within the function.While at it, transform the 'overload' parameter into a flag stored inthe 'sg_status' parameter hence facilitating the definition of new flagswhen needed.Suggested-by: Peter Zijlstra <peterz@infradead.org>Suggested-by: Valentin Schneider <valentin.schneider@arm.com>Signed-off-by: Quentin Perret <quentin.perret@arm.com>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>Cc: Linus Torvalds <torvalds@linux-foundation.org>Cc: Mike Galbraith <efault@gmx.de>Cc: Thomas Gleixner <tglx@linutronix.de>Cc: adharmap@codeaurora.orgCc: chris.redpath@arm.comCc: currojerez@riseup.netCc: dietmar.eggemann@arm.comCc: edubezval@gmail.comCc: gregkh@linuxfoundation.orgCc: javi.merino@kernel.orgCc: joel@joelfernandes.orgCc: juri.lelli@redhat.comCc: morten.rasmussen@arm.comCc: patrick.bellasi@arm.comCc: pkondeti@codeaurora.orgCc: rjw@rjwysocki.netCc: skannan@codeaurora.orgCc: smuckle@google.comCc: srinivas.pandruvada@linux.intel.comCc: thara.gopinath@linaro.orgCc: tkjos@google.comCc: vincent.guittot@linaro.orgCc: viresh.kumar@linaro.orgLink:https://lkml.kernel.org/r/20181203095628.11858-12-quentin.perret@arm.comSigned-off-by: Ingo Molnar <mingo@kernel.org>
1 parent1f74de8 commit630246a

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

‎kernel/sched/fair.c‎

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7905,16 +7905,16 @@ static bool update_nohz_stats(struct rq *rq, bool force)
79057905
* update_sg_lb_stats - Update sched_group's statistics for load balancing.
79067906
* @env: The load balancing environment.
79077907
* @group: sched_group whose statistics are to be updated.
7908-
* @load_idx: Load index of sched_domain of this_cpu for load calc.
7909-
* @local_group: Does group contain this_cpu.
79107908
* @sgs: variable to hold the statistics for this group.
7911-
* @overload: Indicate pullable load (e.g. >1 runnable task).
7909+
* @sg_status: Holds flag indicating the status of the sched_group
79127910
*/
79137911
staticinlinevoidupdate_sg_lb_stats(structlb_env*env,
7914-
structsched_group*group,intload_idx,
7915-
intlocal_group,structsg_lb_stats*sgs,
7916-
bool*overload)
7912+
structsched_group*group,
7913+
structsg_lb_stats*sgs,
7914+
int*sg_status)
79177915
{
7916+
intlocal_group=cpumask_test_cpu(env->dst_cpu,sched_group_span(group));
7917+
intload_idx=get_sd_load_idx(env->sd,env->idle);
79187918
unsigned longload;
79197919
inti,nr_running;
79207920

@@ -7938,7 +7938,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
79387938

79397939
nr_running=rq->nr_running;
79407940
if (nr_running>1)
7941-
*overload= true;
7941+
*sg_status |=SG_OVERLOAD;
79427942

79437943
#ifdefCONFIG_NUMA_BALANCING
79447944
sgs->nr_numa_running+=rq->nr_numa_running;
@@ -7954,7 +7954,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
79547954
if (env->sd->flags&SD_ASYM_CPUCAPACITY&&
79557955
sgs->group_misfit_task_load<rq->misfit_task_load) {
79567956
sgs->group_misfit_task_load=rq->misfit_task_load;
7957-
*overload=1;
7957+
*sg_status |=SG_OVERLOAD;
79587958
}
79597959
}
79607960

@@ -8099,17 +8099,14 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
80998099
structsched_group*sg=env->sd->groups;
81008100
structsg_lb_stats*local=&sds->local_stat;
81018101
structsg_lb_statstmp_sgs;
8102-
intload_idx;
8103-
booloverload= false;
81048102
boolprefer_sibling=child&&child->flags&SD_PREFER_SIBLING;
8103+
intsg_status=0;
81058104

81068105
#ifdefCONFIG_NO_HZ_COMMON
81078106
if (env->idle==CPU_NEWLY_IDLE&&READ_ONCE(nohz.has_blocked))
81088107
env->flags |=LBF_NOHZ_STATS;
81098108
#endif
81108109

8111-
load_idx=get_sd_load_idx(env->sd,env->idle);
8112-
81138110
do {
81148111
structsg_lb_stats*sgs=&tmp_sgs;
81158112
intlocal_group;
@@ -8124,8 +8121,7 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
81248121
update_group_capacity(env->sd,env->dst_cpu);
81258122
}
81268123

8127-
update_sg_lb_stats(env,sg,load_idx,local_group,sgs,
8128-
&overload);
8124+
update_sg_lb_stats(env,sg,sgs,&sg_status);
81298125

81308126
if (local_group)
81318127
gotonext_group;
@@ -8175,8 +8171,7 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
81758171

81768172
if (!env->sd->parent) {
81778173
/* update overload indicator if we are at root domain */
8178-
if (READ_ONCE(env->dst_rq->rd->overload)!=overload)
8179-
WRITE_ONCE(env->dst_rq->rd->overload,overload);
8174+
WRITE_ONCE(env->dst_rq->rd->overload,sg_status&SG_OVERLOAD);
81808175
}
81818176
}
81828177

‎kernel/sched/sched.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,9 @@ struct perf_domain {
716716
structrcu_headrcu;
717717
};
718718

719+
/* Scheduling group status flags */
720+
#defineSG_OVERLOAD0x1/* More than one runnable task on a CPU. */
721+
719722
/*
720723
* We add the notion of a root-domain which will be used to define per-domain
721724
* variables. Each exclusive cpuset essentially defines an island domain by

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp