cpuset: avoid unnecessary sched domains rebuilding
When changing 'sched_relax_domain_level', don't rebuild sched domains if 'cpus' is empty or 'sched_load_balance' is not set. Also make the comments of rebuild_sched_domains() more readable. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Cc: Paul Jackson <pj@sgi.com> Cc: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f9b4fb8dab
commit
c372e817af
1 changed files with 12 additions and 6 deletions
|
@ -496,11 +496,16 @@ update_domain_attr(struct sched_domain_attr *dattr, struct cpuset *c)
|
||||||
/*
|
/*
|
||||||
* rebuild_sched_domains()
|
* rebuild_sched_domains()
|
||||||
*
|
*
|
||||||
* If the flag 'sched_load_balance' of any cpuset with non-empty
|
* This routine will be called to rebuild the scheduler's dynamic
|
||||||
* 'cpus' changes, or if the 'cpus' allowed changes in any cpuset
|
* sched domains:
|
||||||
* which has that flag enabled, or if any cpuset with a non-empty
|
* - if the flag 'sched_load_balance' of any cpuset with non-empty
|
||||||
* 'cpus' is removed, then call this routine to rebuild the
|
* 'cpus' changes,
|
||||||
* scheduler's dynamic sched domains.
|
* - or if the 'cpus' allowed changes in any cpuset which has that
|
||||||
|
* flag enabled,
|
||||||
|
* - or if the 'sched_relax_domain_level' of any cpuset which has
|
||||||
|
* that flag enabled and with non-empty 'cpus' changes,
|
||||||
|
* - or if any cpuset with non-empty 'cpus' is removed,
|
||||||
|
* - or if a cpu gets offlined.
|
||||||
*
|
*
|
||||||
* This routine builds a partial partition of the systems CPUs
|
* This routine builds a partial partition of the systems CPUs
|
||||||
* (the set of non-overlappping cpumask_t's in the array 'part'
|
* (the set of non-overlappping cpumask_t's in the array 'part'
|
||||||
|
@ -1076,7 +1081,8 @@ static int update_relax_domain_level(struct cpuset *cs, s64 val)
|
||||||
|
|
||||||
if (val != cs->relax_domain_level) {
|
if (val != cs->relax_domain_level) {
|
||||||
cs->relax_domain_level = val;
|
cs->relax_domain_level = val;
|
||||||
rebuild_sched_domains();
|
if (!cpus_empty(cs->cpus_allowed) && is_sched_load_balance(cs))
|
||||||
|
rebuild_sched_domains();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue