Commit ee79d1bdb6a10499e53f80b1e8d14110215178ba

Authored by Heiko Carstens
Committed by Ingo Molnar
1 parent c1dfdc7597

sched: let arch_update_cpu_topology indicate if topology changed

Change arch_update_cpu_topology so it returns 1 if the cpu topology changed
and 0 if it didn't change. This will be useful for the next patch which adds
a call to this function in partition_sched_domains.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 3 changed files with 11 additions and 4 deletions Side-by-side Diff

arch/s390/kernel/topology.c
... ... @@ -212,7 +212,7 @@
212 212 cpu_core_map[cpu] = cpu_coregroup_map(cpu);
213 213 }
214 214  
215   -void arch_update_cpu_topology(void)
  215 +int arch_update_cpu_topology(void)
216 216 {
217 217 struct tl_info *info = tl_info;
218 218 struct sys_device *sysdev;
... ... @@ -221,7 +221,7 @@
221 221 if (!machine_has_topology) {
222 222 update_cpu_core_map();
223 223 topology_update_polarization_simple();
224   - return;
  224 + return 0;
225 225 }
226 226 stsi(info, 15, 1, 2);
227 227 tl_to_cores(info);
... ... @@ -230,6 +230,7 @@
230 230 sysdev = get_cpu_sysdev(cpu);
231 231 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE);
232 232 }
  233 + return 1;
233 234 }
234 235  
235 236 static void topology_work_fn(struct work_struct *work)
include/linux/topology.h
... ... @@ -49,7 +49,7 @@
49 49 for_each_online_node(node) \
50 50 if (nr_cpus_node(node))
51 51  
52   -void arch_update_cpu_topology(void);
  52 +int arch_update_cpu_topology(void);
53 53  
54 54 /* Conform to ACPI 2.0 SLIT distance definitions */
55 55 #define LOCAL_DISTANCE 10
... ... @@ -7675,8 +7675,14 @@
7675 7675 */
7676 7676 static cpumask_t fallback_doms;
7677 7677  
7678   -void __attribute__((weak)) arch_update_cpu_topology(void)
  7678 +/*
  7679 + * arch_update_cpu_topology lets virtualized architectures update the
  7680 + * cpu core maps. It is supposed to return 1 if the topology changed
  7681 + * or 0 if it stayed the same.
  7682 + */
  7683 +int __attribute__((weak)) arch_update_cpu_topology(void)
7679 7684 {
  7685 + return 0;
7680 7686 }
7681 7687  
7682 7688 /*