Skip to contentSkip to conversation

cgroup/cpuset: Update stale generate_sched_domains() comments

PATCH In review Juri Lelli 3 participants 5 messages Dec 19, 2018 – Apr 19, 2019

Subsystems (3)
lore
Share & tools
lore

Juri Lelli

author maintainer
#0 lore raw

PATCH 1/2 cgroup/cpuset: Update stale generate_sched_domains() comments

Commit fc560a26acce ("cpuset: replace cpuset->stack_list with cpuset_for_each_descendant_pre()") removed the local list (q) that was used to perform a top-down scan of all cpusets; however, comments mentioning it were not updated.

Update comments to reflect current implementation.

---
 kernel/cgroup/cpuset.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
kernel/cgroup/cpuset.c +5 -6
index f0decd8165e7..f0822a730879 100644
@@ -725,11 +725,10 @@ static inline int nr_cpusets(void)
  * Must be called with cpuset_mutex held.
  *
  * The three key local variables below are:
- *    q  - a linked-list queue of cpuset pointers, used to implement a
- *	   top-down scan of all cpusets.  This scan loads a pointer
- *	   to each cpuset marked is_sched_load_balance into the
- *	   array 'csa'.  For our purposes, rebuilding the schedulers
- *	   sched domains, we can ignore !is_sched_load_balance cpusets.
+ *    cp - cpuset pointer, used (together with pos_css) to perform a
+ *	   top-down scan of all cpusets. For our purposes, rebuilding
+ *	   the schedulers sched domains, we can ignore !is_sched_load_
+ *	   balance cpusets.
  *  csa  - (for CpuSet Array) Array of pointers to all the cpusets
  *	   that need to be load balanced, for convenient iterative
  *	   access by the subsequent code that finds the best partition,
@@ -760,7 +759,7 @@ static inline int nr_cpusets(void)
 static int generate_sched_domains(cpumask_var_t **domains,
 			struct sched_domain_attr **attributes)
 {
-	struct cpuset *cp;	/* scans q */
+	struct cpuset *cp;	/* top-down scan of cpusets */
 	struct cpuset **csa;	/* array of all cpuset ptrs */
 	int csn;		/* how many cpuset ptrs in csa so far */
 	int i, j, k;		/* indices for partition finding loops */
Signature · 1 line
2.17.2
author maintainer
#1 lore raw

PATCH 2/2 sched/topology: Update init_sched_domains() comment

Holding hotplug lock is not a requirement anymore for callers of sched_ init_domains after commit 6acce3ef8452 ("sched: Remove get_online_cpus() usage").

Update the relative comment preceding init_sched_domains().

---
 kernel/sched/topology.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/sched/topology.c +2 -3
index 8d7f15ba5916..10e61b62f138 100644
@@ -1850,9 +1850,8 @@ void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms)
 }
 
 /*
- * Set up scheduler domains and groups. Callers must hold the hotplug lock.
- * For now this just excludes isolated CPUs, but could be used to
- * exclude other special cases in the future.
+ * Set up scheduler domains and groups.  For now this just excludes isolated
+ * CPUs, but could be used to exclude other special cases in the future.
  */
 int sched_init_domains(const struct cpumask *cpu_map)
 {
Signature · 1 line
2.17.2
#2 lore raw

[tip:sched/core] sched/topology: Update init_sched_domains() comment

sched/topology: Update init_sched_domains() comment
Commit-ID:  cb0c04143b6196f4a479ba113706329fc667ee15
Gitweb:     https://git.kernel.org/tip/cb0c04143b6196f4a479ba113706329fc667ee15
Author:     Juri Lelli <[email protected]>
AuthorDate: Wed, 19 Dec 2018 14:34:45 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 19 Apr 2019 19:44:15 +0200

sched/topology: Update init_sched_domains() comment

Holding hotplug lock is not a requirement anymore for callers of sched_ init_domains after commit:

6acce3ef8452 ("sched: Remove get_online_cpus() usage")

Update the relative comment preceding init_sched_domains().

---
 kernel/sched/topology.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/sched/topology.c +2 -3
index c65b31e9458b..f53f89df837d 100644
@@ -2081,9 +2081,8 @@ void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms)
 }
 
 /*
- * Set up scheduler domains and groups. Callers must hold the hotplug lock.
- * For now this just excludes isolated CPUs, but could be used to
- * exclude other special cases in the future.
+ * Set up scheduler domains and groups.  For now this just excludes isolated
+ * CPUs, but could be used to exclude other special cases in the future.
  */
 int sched_init_domains(const struct cpumask *cpu_map)
 {
maintainer Acked-by on v1 1/2
#3 lore raw
In reply to Juri Lelli
Quoted 8 lines · Juri Lelli

Commit fc560a26acce ("cpuset: replace cpuset->stack_list with cpuset_for_each_descendant_pre()") removed the local list (q) that was used to perform a top-down scan of all cpusets; however, comments mentioning it were not updated.

Update comments to reflect current implementation.

Prolly better to route through scheduler tree together with the second patch?

Thanks.

Signature · 1 line
tejun
#4 lore raw
In reply to Juri Lelli
cgroup/cpuset: Update stale generate_sched_domains() comments
Commit-ID:  b6fbbf31d15b5072250ec6ed79e415a1160e5621
Gitweb:     https://git.kernel.org/tip/b6fbbf31d15b5072250ec6ed79e415a1160e5621
Author:     Juri Lelli <[email protected]>
AuthorDate: Wed, 19 Dec 2018 14:34:44 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 19 Apr 2019 19:44:14 +0200

cgroup/cpuset: Update stale generate_sched_domains() comments

Commit:

fc560a26acce ("cpuset: replace cpuset->stack_list with cpuset_for_each_descendant_pre()")

removed the local list (q) that was used to perform a top-down scan of all cpusets; however, comments mentioning it were not updated.

Update comments to reflect current implementation.

---
 kernel/cgroup/cpuset.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
kernel/cgroup/cpuset.c +5 -6
index 4834c4214e9c..6a1942ed781c 100644
@@ -740,11 +740,10 @@ static inline int nr_cpusets(void)
  * Must be called with cpuset_mutex held.
  *
  * The three key local variables below are:
- *    q  - a linked-list queue of cpuset pointers, used to implement a
- *	   top-down scan of all cpusets.  This scan loads a pointer
- *	   to each cpuset marked is_sched_load_balance into the
- *	   array 'csa'.  For our purposes, rebuilding the schedulers
- *	   sched domains, we can ignore !is_sched_load_balance cpusets.
+ *    cp - cpuset pointer, used (together with pos_css) to perform a
+ *	   top-down scan of all cpusets. For our purposes, rebuilding
+ *	   the schedulers sched domains, we can ignore !is_sched_load_
+ *	   balance cpusets.
  *  csa  - (for CpuSet Array) Array of pointers to all the cpusets
  *	   that need to be load balanced, for convenient iterative
  *	   access by the subsequent code that finds the best partition,
@@ -775,7 +774,7 @@ static inline int nr_cpusets(void)
 static int generate_sched_domains(cpumask_var_t **domains,
 			struct sched_domain_attr **attributes)
 {
-	struct cpuset *cp;	/* scans q */
+	struct cpuset *cp;	/* top-down scan of cpusets */
 	struct cpuset **csa;	/* array of all cpuset ptrs */
 	int csn;		/* how many cpuset ptrs in csa so far */
 	int i, j, k;		/* indices for partition finding loops */