Commit 06931e62246844c73fba24d7aeb4a5dc897a2739

Authored by Bartosz Golaszewski
Committed by Ingo Molnar
1 parent 0fb0328d34

sched/topology: Rename topology_thread_cpumask() to topology_sibling_cpumask()

Rename topology_thread_cpumask() to topology_sibling_cpumask()
for more consistency with scheduler code.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Benoit Cousson <bcousson@baylibre.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Link: http://lkml.kernel.org/r/1432645896-12588-2-git-send-email-bgolaszewski@baylibre.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

Showing 20 changed files with 26 additions and 25 deletions Side-by-side Diff

Documentation/cputopology.txt
... ... @@ -44,7 +44,7 @@
44 44 #define topology_physical_package_id(cpu)
45 45 #define topology_core_id(cpu)
46 46 #define topology_book_id(cpu)
47   -#define topology_thread_cpumask(cpu)
  47 +#define topology_sibling_cpumask(cpu)
48 48 #define topology_core_cpumask(cpu)
49 49 #define topology_book_cpumask(cpu)
50 50  
arch/arm/include/asm/topology.h
... ... @@ -18,7 +18,7 @@
18 18 #define topology_physical_package_id(cpu) (cpu_topology[cpu].socket_id)
19 19 #define topology_core_id(cpu) (cpu_topology[cpu].core_id)
20 20 #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling)
21   -#define topology_thread_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
  21 +#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
22 22  
23 23 void init_cpu_topology(void);
24 24 void store_cpu_topology(unsigned int cpuid);
arch/arm64/include/asm/topology.h
... ... @@ -18,7 +18,7 @@
18 18 #define topology_physical_package_id(cpu) (cpu_topology[cpu].cluster_id)
19 19 #define topology_core_id(cpu) (cpu_topology[cpu].core_id)
20 20 #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling)
21   -#define topology_thread_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
  21 +#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
22 22  
23 23 void init_cpu_topology(void);
24 24 void store_cpu_topology(unsigned int cpuid);
arch/ia64/include/asm/topology.h
... ... @@ -53,7 +53,7 @@
53 53 #define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id)
54 54 #define topology_core_id(cpu) (cpu_data(cpu)->core_id)
55 55 #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
56   -#define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  56 +#define topology_sibling_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
57 57 #endif
58 58  
59 59 extern void arch_fix_phys_package_id(int num, u32 slot);
arch/mips/include/asm/topology.h
... ... @@ -15,7 +15,7 @@
15 15 #define topology_physical_package_id(cpu) (cpu_data[cpu].package)
16 16 #define topology_core_id(cpu) (cpu_data[cpu].core)
17 17 #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
18   -#define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu])
  18 +#define topology_sibling_cpumask(cpu) (&cpu_sibling_map[cpu])
19 19 #endif
20 20  
21 21 #endif /* __ASM_TOPOLOGY_H */
arch/powerpc/include/asm/topology.h
... ... @@ -87,7 +87,7 @@
87 87 #include <asm/smp.h>
88 88  
89 89 #define topology_physical_package_id(cpu) (cpu_to_chip_id(cpu))
90   -#define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
  90 +#define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
91 91 #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
92 92 #define topology_core_id(cpu) (cpu_to_core_id(cpu))
93 93 #endif
arch/powerpc/mm/tlb_nohash.c
... ... @@ -217,7 +217,7 @@
217 217 static int mm_is_core_local(struct mm_struct *mm)
218 218 {
219 219 return cpumask_subset(mm_cpumask(mm),
220   - topology_thread_cpumask(smp_processor_id()));
  220 + topology_sibling_cpumask(smp_processor_id()));
221 221 }
222 222  
223 223 struct tlb_flush_param {
arch/s390/include/asm/topology.h
... ... @@ -22,7 +22,8 @@
22 22  
23 23 #define topology_physical_package_id(cpu) (per_cpu(cpu_topology, cpu).socket_id)
24 24 #define topology_thread_id(cpu) (per_cpu(cpu_topology, cpu).thread_id)
25   -#define topology_thread_cpumask(cpu) (&per_cpu(cpu_topology, cpu).thread_mask)
  25 +#define topology_sibling_cpumask(cpu) \
  26 + (&per_cpu(cpu_topology, cpu).thread_mask)
26 27 #define topology_core_id(cpu) (per_cpu(cpu_topology, cpu).core_id)
27 28 #define topology_core_cpumask(cpu) (&per_cpu(cpu_topology, cpu).core_mask)
28 29 #define topology_book_id(cpu) (per_cpu(cpu_topology, cpu).book_id)
arch/sparc/include/asm/topology_64.h
... ... @@ -41,7 +41,7 @@
41 41 #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
42 42 #define topology_core_id(cpu) (cpu_data(cpu).core_id)
43 43 #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
44   -#define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  44 +#define topology_sibling_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
45 45 #endif /* CONFIG_SMP */
46 46  
47 47 extern cpumask_t cpu_core_map[NR_CPUS];
arch/tile/include/asm/topology.h
... ... @@ -55,7 +55,7 @@
55 55 #define topology_physical_package_id(cpu) ((void)(cpu), 0)
56 56 #define topology_core_id(cpu) (cpu)
57 57 #define topology_core_cpumask(cpu) ((void)(cpu), cpu_online_mask)
58   -#define topology_thread_cpumask(cpu) cpumask_of(cpu)
  58 +#define topology_sibling_cpumask(cpu) cpumask_of(cpu)
59 59 #endif
60 60  
61 61 #endif /* _ASM_TILE_TOPOLOGY_H */
arch/x86/include/asm/topology.h
... ... @@ -124,7 +124,7 @@
124 124  
125 125 #ifdef ENABLE_TOPO_DEFINES
126 126 #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
127   -#define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
  127 +#define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
128 128 #endif
129 129  
130 130 static inline void arch_fix_phys_package_id(int num, u32 slot)
arch/x86/kernel/cpu/perf_event_intel.c
... ... @@ -2621,7 +2621,7 @@
2621 2621 if (!(x86_pmu.flags & PMU_FL_NO_HT_SHARING)) {
2622 2622 void **onln = &cpuc->kfree_on_online[X86_PERF_KFREE_SHARED];
2623 2623  
2624   - for_each_cpu(i, topology_thread_cpumask(cpu)) {
  2624 + for_each_cpu(i, topology_sibling_cpumask(cpu)) {
2625 2625 struct intel_shared_regs *pc;
2626 2626  
2627 2627 pc = per_cpu(cpu_hw_events, i).shared_regs;
... ... @@ -2641,7 +2641,7 @@
2641 2641 if (x86_pmu.flags & PMU_FL_EXCL_CNTRS) {
2642 2642 int h = x86_pmu.num_counters >> 1;
2643 2643  
2644   - for_each_cpu(i, topology_thread_cpumask(cpu)) {
  2644 + for_each_cpu(i, topology_sibling_cpumask(cpu)) {
2645 2645 struct intel_excl_cntrs *c;
2646 2646  
2647 2647 c = per_cpu(cpu_hw_events, i).excl_cntrs;
... ... @@ -3403,7 +3403,7 @@
3403 3403 if (!(x86_pmu.flags & PMU_FL_EXCL_ENABLED))
3404 3404 return 0;
3405 3405  
3406   - w = cpumask_weight(topology_thread_cpumask(cpu));
  3406 + w = cpumask_weight(topology_sibling_cpumask(cpu));
3407 3407 if (w > 1) {
3408 3408 pr_info("PMU erratum BJ122, BV98, HSD29 worked around, HT is on\n");
3409 3409 return 0;
block/blk-mq-cpumap.c
... ... @@ -24,7 +24,7 @@
24 24 {
25 25 unsigned int ret;
26 26  
27   - ret = cpumask_first(topology_thread_cpumask(cpu));
  27 + ret = cpumask_first(topology_sibling_cpumask(cpu));
28 28 if (ret < nr_cpu_ids)
29 29 return ret;
30 30  
drivers/acpi/acpi_pad.c
... ... @@ -105,7 +105,7 @@
105 105 mutex_lock(&round_robin_lock);
106 106 cpumask_clear(tmp);
107 107 for_each_cpu(cpu, pad_busy_cpus)
108   - cpumask_or(tmp, tmp, topology_thread_cpumask(cpu));
  108 + cpumask_or(tmp, tmp, topology_sibling_cpumask(cpu));
109 109 cpumask_andnot(tmp, cpu_online_mask, tmp);
110 110 /* avoid HT sibilings if possible */
111 111 if (cpumask_empty(tmp))
drivers/base/topology.c
... ... @@ -61,7 +61,7 @@
61 61 define_id_show_func(core_id);
62 62 static DEVICE_ATTR_RO(core_id);
63 63  
64   -define_siblings_show_func(thread_siblings, thread_cpumask);
  64 +define_siblings_show_func(thread_siblings, sibling_cpumask);
65 65 static DEVICE_ATTR_RO(thread_siblings);
66 66 static DEVICE_ATTR_RO(thread_siblings_list);
67 67  
drivers/net/ethernet/sfc/efx.c
... ... @@ -1304,7 +1304,7 @@
1304 1304 if (!cpumask_test_cpu(cpu, thread_mask)) {
1305 1305 ++count;
1306 1306 cpumask_or(thread_mask, thread_mask,
1307   - topology_thread_cpumask(cpu));
  1307 + topology_sibling_cpumask(cpu));
1308 1308 }
1309 1309 }
1310 1310  
drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c
... ... @@ -87,7 +87,7 @@
87 87 /* return cpumask of HTs in the same core */
88 88 static void cfs_cpu_ht_siblings(int cpu, cpumask_t *mask)
89 89 {
90   - cpumask_copy(mask, topology_thread_cpumask(cpu));
  90 + cpumask_copy(mask, topology_sibling_cpumask(cpu));
91 91 }
92 92  
93 93 static void cfs_node_to_cpumask(int node, cpumask_t *mask)
drivers/staging/lustre/lustre/ptlrpc/service.c
... ... @@ -557,7 +557,7 @@
557 557 * there are.
558 558 */
559 559 /* weight is # of HTs */
560   - if (cpumask_weight(topology_thread_cpumask(0)) > 1) {
  560 + if (cpumask_weight(topology_sibling_cpumask(0)) > 1) {
561 561 /* depress thread factor for hyper-thread */
562 562 factor = factor - (factor >> 1) + (factor >> 3);
563 563 }
... ... @@ -2768,7 +2768,7 @@
2768 2768  
2769 2769 init_waitqueue_head(&ptlrpc_hr.hr_waitq);
2770 2770  
2771   - weight = cpumask_weight(topology_thread_cpumask(0));
  2771 + weight = cpumask_weight(topology_sibling_cpumask(0));
2772 2772  
2773 2773 cfs_percpt_for_each(hrp, i, ptlrpc_hr.hr_partitions) {
2774 2774 hrp->hrp_cpt = i;
include/linux/topology.h
... ... @@ -191,8 +191,8 @@
191 191 #ifndef topology_core_id
192 192 #define topology_core_id(cpu) ((void)(cpu), 0)
193 193 #endif
194   -#ifndef topology_thread_cpumask
195   -#define topology_thread_cpumask(cpu) cpumask_of(cpu)
  194 +#ifndef topology_sibling_cpumask
  195 +#define topology_sibling_cpumask(cpu) cpumask_of(cpu)
196 196 #endif
197 197 #ifndef topology_core_cpumask
198 198 #define topology_core_cpumask(cpu) cpumask_of(cpu)
... ... @@ -201,7 +201,7 @@
201 201 #ifdef CONFIG_SCHED_SMT
202 202 static inline const struct cpumask *cpu_smt_mask(int cpu)
203 203 {
204   - return topology_thread_cpumask(cpu);
  204 + return topology_sibling_cpumask(cpu);
205 205 }
206 206 #endif
207 207  
... ... @@ -191,7 +191,7 @@
191 191 /* Update distances based on topology */
192 192 for_each_cpu(cpu, update_mask) {
193 193 if (cpu_rmap_copy_neigh(rmap, cpu,
194   - topology_thread_cpumask(cpu), 1))
  194 + topology_sibling_cpumask(cpu), 1))
195 195 continue;
196 196 if (cpu_rmap_copy_neigh(rmap, cpu,
197 197 topology_core_cpumask(cpu), 2))