aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h25
-rw-r--r--kernel/sched.c5
2 files changed, 25 insertions, 5 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index de7b3b217772..dbb1043e8656 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -839,7 +839,17 @@ struct sched_group {
839 */ 839 */
840 u32 reciprocal_cpu_power; 840 u32 reciprocal_cpu_power;
841 841
842 unsigned long cpumask[]; 842 /*
843 * The CPUs this group covers.
844 *
845 * NOTE: this field is variable length. (Allocated dynamically
846 * by attaching extra space to the end of the structure,
847 * depending on how many CPUs the kernel has booted up with)
848 *
849 * It is also be embedded into static data structures at build
850 * time. (See 'struct static_sched_group' in kernel/sched.c)
851 */
852 unsigned long cpumask[0];
843}; 853};
844 854
845static inline struct cpumask *sched_group_cpus(struct sched_group *sg) 855static inline struct cpumask *sched_group_cpus(struct sched_group *sg)
@@ -925,8 +935,17 @@ struct sched_domain {
925 char *name; 935 char *name;
926#endif 936#endif
927 937
928 /* span of all CPUs in this domain */ 938 /*
929 unsigned long span[]; 939 * Span of all CPUs in this domain.
940 *
941 * NOTE: this field is variable length. (Allocated dynamically
942 * by attaching extra space to the end of the structure,
943 * depending on how many CPUs the kernel has booted up with)
944 *
945 * It is also be embedded into static data structures at build
946 * time. (See 'struct static_sched_domain' in kernel/sched.c)
947 */
948 unsigned long span[0];
930}; 949};
931 950
932static inline struct cpumask *sched_domain_span(struct sched_domain *sd) 951static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
diff --git a/kernel/sched.c b/kernel/sched.c
index 497c09ba61e7..228acae8821f 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7948,8 +7948,9 @@ int sched_smt_power_savings = 0, sched_mc_power_savings = 0;
7948 7948
7949/* 7949/*
7950 * The cpus mask in sched_group and sched_domain hangs off the end. 7950 * The cpus mask in sched_group and sched_domain hangs off the end.
7951 * FIXME: use cpumask_var_t or dynamic percpu alloc to avoid wasting space 7951 *
7952 * for nr_cpu_ids < CONFIG_NR_CPUS. 7952 * ( See the the comments in include/linux/sched.h:struct sched_group
7953 * and struct sched_domain. )
7953 */ 7954 */
7954struct static_sched_group { 7955struct static_sched_group {
7955 struct sched_group sg; 7956 struct sched_group sg;