Merge branch 'cpus4096-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'cpus4096-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
cpu masks: optimize and clean up cpumask_of_cpu()
cpumask: export cpumask_of_cpu_map
cpumask: change cpumask_of_cpu_ptr to use new cpumask_of_cpu
cpumask: put cpumask_of_cpu_map in the initdata section
cpumask: make cpumask_of_cpu_map generic

+85 -141
+1 -2
arch/x86/kernel/acpi/cstate.c
··· 73 73 struct cpuinfo_x86 *c = &cpu_data(cpu); 74 74 75 75 cpumask_t saved_mask; 76 - cpumask_of_cpu_ptr(new_mask, cpu); 77 76 int retval; 78 77 unsigned int eax, ebx, ecx, edx; 79 78 unsigned int edx_part; ··· 91 92 92 93 /* Make sure we are running on right CPU */ 93 94 saved_mask = current->cpus_allowed; 94 - retval = set_cpus_allowed_ptr(current, new_mask); 95 + retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 95 96 if (retval) 96 97 return -1; 97 98
+3 -7
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
··· 200 200 static void drv_write(struct drv_cmd *cmd) 201 201 { 202 202 cpumask_t saved_mask = current->cpus_allowed; 203 - cpumask_of_cpu_ptr_declare(cpu_mask); 204 203 unsigned int i; 205 204 206 205 for_each_cpu_mask_nr(i, cmd->mask) { 207 - cpumask_of_cpu_ptr_next(cpu_mask, i); 208 - set_cpus_allowed_ptr(current, cpu_mask); 206 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(i)); 209 207 do_drv_write(cmd); 210 208 } 211 209 ··· 267 269 } aperf_cur, mperf_cur; 268 270 269 271 cpumask_t saved_mask; 270 - cpumask_of_cpu_ptr(cpu_mask, cpu); 271 272 unsigned int perf_percent; 272 273 unsigned int retval; 273 274 274 275 saved_mask = current->cpus_allowed; 275 - set_cpus_allowed_ptr(current, cpu_mask); 276 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 276 277 if (get_cpu() != cpu) { 277 278 /* We were not able to run on requested processor */ 278 279 put_cpu(); ··· 337 340 338 341 static unsigned int get_cur_freq_on_cpu(unsigned int cpu) 339 342 { 340 - cpumask_of_cpu_ptr(cpu_mask, cpu); 341 343 struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu); 342 344 unsigned int freq; 343 345 unsigned int cached_freq; ··· 349 353 } 350 354 351 355 cached_freq = data->freq_table[data->acpi_data->state].frequency; 352 - freq = extract_freq(get_cur_val(cpu_mask), data); 356 + freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data); 353 357 if (freq != cached_freq) { 354 358 /* 355 359 * The dreaded BIOS frequency change behind our back.
+5 -10
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
··· 479 479 static int check_supported_cpu(unsigned int cpu) 480 480 { 481 481 cpumask_t oldmask; 482 - cpumask_of_cpu_ptr(cpu_mask, cpu); 483 482 u32 eax, ebx, ecx, edx; 484 483 unsigned int rc = 0; 485 484 486 485 oldmask = current->cpus_allowed; 487 - set_cpus_allowed_ptr(current, cpu_mask); 486 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 488 487 489 488 if (smp_processor_id() != cpu) { 490 489 printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu); ··· 1016 1017 static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) 1017 1018 { 1018 1019 cpumask_t oldmask; 1019 - cpumask_of_cpu_ptr(cpu_mask, pol->cpu); 1020 1020 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); 1021 1021 u32 checkfid; 1022 1022 u32 checkvid; ··· 1030 1032 1031 1033 /* only run on specific CPU from here on */ 1032 1034 oldmask = current->cpus_allowed; 1033 - set_cpus_allowed_ptr(current, cpu_mask); 1035 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu)); 1034 1036 1035 1037 if (smp_processor_id() != pol->cpu) { 1036 1038 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); ··· 1105 1107 { 1106 1108 struct powernow_k8_data *data; 1107 1109 cpumask_t oldmask; 1108 - cpumask_of_cpu_ptr_declare(newmask); 1109 1110 int rc; 1110 1111 1111 1112 if (!cpu_online(pol->cpu)) ··· 1156 1159 1157 1160 /* only run on specific CPU from here on */ 1158 1161 oldmask = current->cpus_allowed; 1159 - cpumask_of_cpu_ptr_next(newmask, pol->cpu); 1160 - set_cpus_allowed_ptr(current, newmask); 1162 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu)); 1161 1163 1162 1164 if (smp_processor_id() != pol->cpu) { 1163 1165 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); ··· 1178 1182 set_cpus_allowed_ptr(current, &oldmask); 1179 1183 1180 1184 if (cpu_family == CPU_HW_PSTATE) 1181 - pol->cpus = *newmask; 1185 + pol->cpus = cpumask_of_cpu(pol->cpu); 1182 1186 else 1183 1187 pol->cpus = per_cpu(cpu_core_map, pol->cpu); 1184 1188 data->available_cores = &(pol->cpus); ··· 1244 1248 { 1245 1249 struct powernow_k8_data *data; 1246 1250 cpumask_t oldmask = current->cpus_allowed; 1247 - cpumask_of_cpu_ptr(newmask, cpu); 1248 1251 unsigned int khz = 0; 1249 1252 unsigned int first; 1250 1253 ··· 1253 1258 if (!data) 1254 1259 return -EINVAL; 1255 1260 1256 - set_cpus_allowed_ptr(current, newmask); 1261 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 1257 1262 if (smp_processor_id() != cpu) { 1258 1263 printk(KERN_ERR PFX 1259 1264 "limiting to CPU %d failed in powernowk8_get\n", cpu);
+4 -8
arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
··· 324 324 unsigned l, h; 325 325 unsigned clock_freq; 326 326 cpumask_t saved_mask; 327 - cpumask_of_cpu_ptr(new_mask, cpu); 328 327 329 328 saved_mask = current->cpus_allowed; 330 - set_cpus_allowed_ptr(current, new_mask); 329 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 331 330 if (smp_processor_id() != cpu) 332 331 return 0; 333 332 ··· 584 585 * Best effort undo.. 585 586 */ 586 587 587 - if (!cpus_empty(*covered_cpus)) { 588 - cpumask_of_cpu_ptr_declare(new_mask); 589 - 588 + if (!cpus_empty(*covered_cpus)) 590 589 for_each_cpu_mask_nr(j, *covered_cpus) { 591 - cpumask_of_cpu_ptr_next(new_mask, j); 592 - set_cpus_allowed_ptr(current, new_mask); 590 + set_cpus_allowed_ptr(current, 591 + &cpumask_of_cpu(j)); 593 592 wrmsr(MSR_IA32_PERF_CTL, oldmsr, h); 594 593 } 595 - } 596 594 597 595 tmp = freqs.new; 598 596 freqs.new = freqs.old;
+1 -2
arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
··· 244 244 245 245 static unsigned int speedstep_get(unsigned int cpu) 246 246 { 247 - cpumask_of_cpu_ptr(newmask, cpu); 248 - return _speedstep_get(newmask); 247 + return _speedstep_get(&cpumask_of_cpu(cpu)); 249 248 } 250 249 251 250 /**
+1 -2
arch/x86/kernel/cpu/intel_cacheinfo.c
··· 516 516 unsigned long j; 517 517 int retval; 518 518 cpumask_t oldmask; 519 - cpumask_of_cpu_ptr(newmask, cpu); 520 519 521 520 if (num_cache_leaves == 0) 522 521 return -ENOENT; ··· 526 527 return -ENOMEM; 527 528 528 529 oldmask = current->cpus_allowed; 529 - retval = set_cpus_allowed_ptr(current, newmask); 530 + retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 530 531 if (retval) 531 532 goto out; 532 533
+2 -4
arch/x86/kernel/ldt.c
··· 62 62 63 63 if (reload) { 64 64 #ifdef CONFIG_SMP 65 - cpumask_of_cpu_ptr_declare(mask); 66 - 67 65 preempt_disable(); 68 66 load_LDT(pc); 69 - cpumask_of_cpu_ptr_next(mask, smp_processor_id()); 70 - if (!cpus_equal(current->mm->cpu_vm_mask, *mask)) 67 + if (!cpus_equal(current->mm->cpu_vm_mask, 68 + cpumask_of_cpu(smp_processor_id()))) 71 69 smp_call_function(flush_ldt, current->mm, 1); 72 70 preempt_enable(); 73 71 #else
+5 -12
arch/x86/kernel/microcode.c
··· 388 388 void *new_mc = NULL; 389 389 int cpu; 390 390 cpumask_t old; 391 - cpumask_of_cpu_ptr_declare(newmask); 392 391 393 392 old = current->cpus_allowed; 394 393 ··· 404 405 405 406 if (!uci->valid) 406 407 continue; 407 - cpumask_of_cpu_ptr_next(newmask, cpu); 408 - set_cpus_allowed_ptr(current, newmask); 408 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 409 409 error = get_maching_microcode(new_mc, cpu); 410 410 if (error < 0) 411 411 goto out; ··· 574 576 struct cpuinfo_x86 *c = &cpu_data(cpu); 575 577 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 576 578 cpumask_t old; 577 - cpumask_of_cpu_ptr(newmask, cpu); 578 579 unsigned int val[2]; 579 580 int err = 0; 580 581 ··· 582 585 return 0; 583 586 584 587 old = current->cpus_allowed; 585 - set_cpus_allowed_ptr(current, newmask); 588 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 586 589 587 590 /* Check if the microcode we have in memory matches the CPU */ 588 591 if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || ··· 620 623 static void microcode_init_cpu(int cpu, int resume) 621 624 { 622 625 cpumask_t old; 623 - cpumask_of_cpu_ptr(newmask, cpu); 624 626 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 625 627 626 628 old = current->cpus_allowed; 627 629 628 - set_cpus_allowed_ptr(current, newmask); 630 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 629 631 mutex_lock(&microcode_mutex); 630 632 collect_cpu_info(cpu); 631 633 if (uci->valid && system_state == SYSTEM_RUNNING && !resume) ··· 657 661 if (end == buf) 658 662 return -EINVAL; 659 663 if (val == 1) { 660 - cpumask_t old; 661 - cpumask_of_cpu_ptr(newmask, cpu); 662 - 663 - old = current->cpus_allowed; 664 + cpumask_t old = current->cpus_allowed; 664 665 665 666 get_online_cpus(); 666 - set_cpus_allowed_ptr(current, newmask); 667 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 667 668 668 669 mutex_lock(&microcode_mutex); 669 670 if (uci->valid)
+3 -8
arch/x86/kernel/reboot.c
··· 414 414 415 415 /* The boot cpu is always logical cpu 0 */ 416 416 int reboot_cpu_id = 0; 417 - cpumask_of_cpu_ptr(newmask, reboot_cpu_id); 418 417 419 418 #ifdef CONFIG_X86_32 420 419 /* See if there has been given a command line override */ 421 420 if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) && 422 - cpu_online(reboot_cpu)) { 421 + cpu_online(reboot_cpu)) 423 422 reboot_cpu_id = reboot_cpu; 424 - cpumask_of_cpu_ptr_next(newmask, reboot_cpu_id); 425 - } 426 423 #endif 427 424 428 425 /* Make certain the cpu I'm about to reboot on is online */ 429 - if (!cpu_online(reboot_cpu_id)) { 426 + if (!cpu_online(reboot_cpu_id)) 430 427 reboot_cpu_id = smp_processor_id(); 431 - cpumask_of_cpu_ptr_next(newmask, reboot_cpu_id); 432 - } 433 428 434 429 /* Make certain I only run on the appropriate processor */ 435 - set_cpus_allowed_ptr(current, newmask); 430 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(reboot_cpu_id)); 436 431 437 432 /* O.K Now that I'm on the appropriate processor, 438 433 * stop all of the others.
-21
arch/x86/kernel/setup_percpu.c
··· 80 80 #endif 81 81 } 82 82 83 - #ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP 84 - cpumask_t *cpumask_of_cpu_map __read_mostly; 85 - EXPORT_SYMBOL(cpumask_of_cpu_map); 86 - 87 - /* requires nr_cpu_ids to be initialized */ 88 - static void __init setup_cpumask_of_cpu(void) 89 - { 90 - int i; 91 - 92 - /* alloc_bootmem zeroes memory */ 93 - cpumask_of_cpu_map = alloc_bootmem_low(sizeof(cpumask_t) * nr_cpu_ids); 94 - for (i = 0; i < nr_cpu_ids; i++) 95 - cpu_set(i, cpumask_of_cpu_map[i]); 96 - } 97 - #else 98 - static inline void setup_cpumask_of_cpu(void) { } 99 - #endif 100 - 101 83 #ifdef CONFIG_X86_32 102 84 /* 103 85 * Great future not-so-futuristic plan: make i386 and x86_64 do it ··· 179 197 180 198 /* Setup node to cpumask map */ 181 199 setup_node_to_cpumask_map(); 182 - 183 - /* Setup cpumask_of_cpu map */ 184 - setup_cpumask_of_cpu(); 185 200 } 186 201 187 202 #endif
+3 -8
drivers/acpi/processor_throttling.c
··· 827 827 static int acpi_processor_get_throttling(struct acpi_processor *pr) 828 828 { 829 829 cpumask_t saved_mask; 830 - cpumask_of_cpu_ptr_declare(new_mask); 831 830 int ret; 832 831 833 832 if (!pr) ··· 838 839 * Migrate task to the cpu pointed by pr. 839 840 */ 840 841 saved_mask = current->cpus_allowed; 841 - cpumask_of_cpu_ptr_next(new_mask, pr->id); 842 - set_cpus_allowed_ptr(current, new_mask); 842 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(pr->id)); 843 843 ret = pr->throttling.acpi_processor_get_throttling(pr); 844 844 /* restore the previous state */ 845 845 set_cpus_allowed_ptr(current, &saved_mask); ··· 987 989 int acpi_processor_set_throttling(struct acpi_processor *pr, int state) 988 990 { 989 991 cpumask_t saved_mask; 990 - cpumask_of_cpu_ptr_declare(new_mask); 991 992 int ret = 0; 992 993 unsigned int i; 993 994 struct acpi_processor *match_pr; ··· 1025 1028 * it can be called only for the cpu pointed by pr. 1026 1029 */ 1027 1030 if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) { 1028 - cpumask_of_cpu_ptr_next(new_mask, pr->id); 1029 - set_cpus_allowed_ptr(current, new_mask); 1031 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(pr->id)); 1030 1032 ret = p_throttling->acpi_processor_set_throttling(pr, 1031 1033 t_state.target_state); 1032 1034 } else { ··· 1056 1060 continue; 1057 1061 } 1058 1062 t_state.cpu = i; 1059 - cpumask_of_cpu_ptr_next(new_mask, i); 1060 - set_cpus_allowed_ptr(current, new_mask); 1063 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(i)); 1061 1064 ret = match_pr->throttling. 1062 1065 acpi_processor_set_throttling( 1063 1066 match_pr, t_state.target_state);
+1 -2
drivers/firmware/dcdbas.c
··· 245 245 static int smi_request(struct smi_cmd *smi_cmd) 246 246 { 247 247 cpumask_t old_mask; 248 - cpumask_of_cpu_ptr(new_mask, 0); 249 248 int ret = 0; 250 249 251 250 if (smi_cmd->magic != SMI_CMD_MAGIC) { ··· 255 256 256 257 /* SMI requires CPU 0 */ 257 258 old_mask = current->cpus_allowed; 258 - set_cpus_allowed_ptr(current, new_mask); 259 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(0)); 259 260 if (smp_processor_id() != 0) { 260 261 dev_dbg(&dcdbas_pdev->dev, "%s: failed to get CPU 0\n", 261 262 __func__);
+1 -2
drivers/misc/sgi-xp/xpc_main.c
··· 229 229 int last_IRQ_count = 0; 230 230 int new_IRQ_count; 231 231 int force_IRQ = 0; 232 - cpumask_of_cpu_ptr(cpumask, XPC_HB_CHECK_CPU); 233 232 234 233 /* this thread was marked active by xpc_hb_init() */ 235 234 236 - set_cpus_allowed_ptr(current, cpumask); 235 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(XPC_HB_CHECK_CPU)); 237 236 238 237 /* set our heartbeating to other partitions into motion */ 239 238 xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval * HZ);
+24 -39
include/linux/cpumask.h
··· 62 62 * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids 63 63 * 64 64 * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set 65 - *ifdef CONFIG_HAS_CPUMASK_OF_CPU 66 - * cpumask_of_cpu_ptr_declare(v) Declares cpumask_t *v 67 - * cpumask_of_cpu_ptr_next(v, cpu) Sets v = &cpumask_of_cpu_map[cpu] 68 - * cpumask_of_cpu_ptr(v, cpu) Combines above two operations 69 - *else 70 - * cpumask_of_cpu_ptr_declare(v) Declares cpumask_t _v and *v = &_v 71 - * cpumask_of_cpu_ptr_next(v, cpu) Sets _v = cpumask_of_cpu(cpu) 72 - * cpumask_of_cpu_ptr(v, cpu) Combines above two operations 73 - *endif 65 + * (can be used as an lvalue) 74 66 * CPU_MASK_ALL Initializer - all bits set 75 67 * CPU_MASK_NONE Initializer - no bits set 76 68 * unsigned long *cpus_addr(mask) Array of unsigned long's in mask ··· 265 273 bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); 266 274 } 267 275 276 + /* 277 + * Special-case data structure for "single bit set only" constant CPU masks. 278 + * 279 + * We pre-generate all the 64 (or 32) possible bit positions, with enough 280 + * padding to the left and the right, and return the constant pointer 281 + * appropriately offset. 282 + */ 283 + extern const unsigned long 284 + cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; 268 285 269 - #ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP 270 - extern cpumask_t *cpumask_of_cpu_map; 271 - #define cpumask_of_cpu(cpu) (cpumask_of_cpu_map[cpu]) 272 - #define cpumask_of_cpu_ptr(v, cpu) \ 273 - const cpumask_t *v = &cpumask_of_cpu(cpu) 274 - #define cpumask_of_cpu_ptr_declare(v) \ 275 - const cpumask_t *v 276 - #define cpumask_of_cpu_ptr_next(v, cpu) \ 277 - v = &cpumask_of_cpu(cpu) 278 - #else 279 - #define cpumask_of_cpu(cpu) \ 280 - ({ \ 281 - typeof(_unused_cpumask_arg_) m; \ 282 - if (sizeof(m) == sizeof(unsigned long)) { \ 283 - m.bits[0] = 1UL<<(cpu); \ 284 - } else { \ 285 - cpus_clear(m); \ 286 - cpu_set((cpu), m); \ 287 - } \ 288 - m; \ 289 - }) 290 - #define cpumask_of_cpu_ptr(v, cpu) \ 291 - cpumask_t _##v = cpumask_of_cpu(cpu); \ 292 - const cpumask_t *v = &_##v 293 - #define cpumask_of_cpu_ptr_declare(v) \ 294 - cpumask_t _##v; \ 295 - const cpumask_t *v = &_##v 296 - #define cpumask_of_cpu_ptr_next(v, cpu) \ 297 - _##v = cpumask_of_cpu(cpu) 298 - #endif 286 + static inline const cpumask_t *get_cpu_mask(unsigned int cpu) 287 + { 288 + const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; 289 + p -= cpu / BITS_PER_LONG; 290 + return (const cpumask_t *)p; 291 + } 292 + 293 + /* 294 + * In cases where we take the address of the cpumask immediately, 295 + * gcc optimizes it out (it's a constant) and there's no huge stack 296 + * variable created: 297 + */ 298 + #define cpumask_of_cpu(cpu) ({ *get_cpu_mask(cpu); }) 299 + 299 300 300 301 #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) 301 302
+25
kernel/cpu.c
··· 455 455 #endif /* CONFIG_PM_SLEEP_SMP */ 456 456 457 457 #endif /* CONFIG_SMP */ 458 + 459 + /* 460 + * cpu_bit_bitmap[] is a special, "compressed" data structure that 461 + * represents all NR_CPUS bits binary values of 1<<nr. 462 + * 463 + * It is used by cpumask_of_cpu() to get a constant address to a CPU 464 + * mask value that has a single bit set only. 465 + */ 466 + 467 + /* cpu_bit_bitmap[0] is empty - so we can back into it */ 468 + #define MASK_DECLARE_1(x) [x+1][0] = 1UL << (x) 469 + #define MASK_DECLARE_2(x) MASK_DECLARE_1(x), MASK_DECLARE_1(x+1) 470 + #define MASK_DECLARE_4(x) MASK_DECLARE_2(x), MASK_DECLARE_2(x+2) 471 + #define MASK_DECLARE_8(x) MASK_DECLARE_4(x), MASK_DECLARE_4(x+4) 472 + 473 + const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = { 474 + 475 + MASK_DECLARE_8(0), MASK_DECLARE_8(8), 476 + MASK_DECLARE_8(16), MASK_DECLARE_8(24), 477 + #if BITS_PER_LONG > 32 478 + MASK_DECLARE_8(32), MASK_DECLARE_8(40), 479 + MASK_DECLARE_8(48), MASK_DECLARE_8(56), 480 + #endif 481 + }; 482 + EXPORT_SYMBOL_GPL(cpu_bit_bitmap);
+3 -5
kernel/time/tick-common.c
··· 196 196 struct tick_device *td; 197 197 int cpu, ret = NOTIFY_OK; 198 198 unsigned long flags; 199 - cpumask_of_cpu_ptr_declare(cpumask); 200 199 201 200 spin_lock_irqsave(&tick_device_lock, flags); 202 201 203 202 cpu = smp_processor_id(); 204 - cpumask_of_cpu_ptr_next(cpumask, cpu); 205 203 if (!cpu_isset(cpu, newdev->cpumask)) 206 204 goto out_bc; 207 205 ··· 207 209 curdev = td->evtdev; 208 210 209 211 /* cpu local device ? */ 210 - if (!cpus_equal(newdev->cpumask, *cpumask)) { 212 + if (!cpus_equal(newdev->cpumask, cpumask_of_cpu(cpu))) { 211 213 212 214 /* 213 215 * If the cpu affinity of the device interrupt can not ··· 220 222 * If we have a cpu local device already, do not replace it 221 223 * by a non cpu local device 222 224 */ 223 - if (curdev && cpus_equal(curdev->cpumask, *cpumask)) 225 + if (curdev && cpus_equal(curdev->cpumask, cpumask_of_cpu(cpu))) 224 226 goto out_bc; 225 227 } 226 228 ··· 252 254 curdev = NULL; 253 255 } 254 256 clockevents_exchange_device(curdev, newdev); 255 - tick_setup_device(td, newdev, cpu, cpumask); 257 + tick_setup_device(td, newdev, cpu, &cpumask_of_cpu(cpu)); 256 258 if (newdev->features & CLOCK_EVT_FEAT_ONESHOT) 257 259 tick_oneshot_notify(); 258 260
+1 -3
kernel/trace/trace_sysprof.c
··· 213 213 int cpu; 214 214 215 215 for_each_online_cpu(cpu) { 216 - cpumask_of_cpu_ptr(new_mask, cpu); 217 - 218 - set_cpus_allowed_ptr(current, new_mask); 216 + set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); 219 217 start_stack_timer(cpu); 220 218 } 221 219 set_cpus_allowed_ptr(current, &saved_mask);
+1 -4
lib/smp_processor_id.c
··· 11 11 { 12 12 unsigned long preempt_count = preempt_count(); 13 13 int this_cpu = raw_smp_processor_id(); 14 - cpumask_of_cpu_ptr_declare(this_mask); 15 14 16 15 if (likely(preempt_count)) 17 16 goto out; ··· 22 23 * Kernel threads bound to a single CPU can safely use 23 24 * smp_processor_id(): 24 25 */ 25 - cpumask_of_cpu_ptr_next(this_mask, this_cpu); 26 - 27 - if (cpus_equal(current->cpus_allowed, *this_mask)) 26 + if (cpus_equal(current->cpus_allowed, cpumask_of_cpu(this_cpu))) 28 27 goto out; 29 28 30 29 /*
+1 -2
net/sunrpc/svc.c
··· 310 310 switch (m->mode) { 311 311 case SVC_POOL_PERCPU: 312 312 { 313 - cpumask_of_cpu_ptr(cpumask, node); 314 - set_cpus_allowed_ptr(task, cpumask); 313 + set_cpus_allowed_ptr(task, &cpumask_of_cpu(node)); 315 314 break; 316 315 } 317 316 case SVC_POOL_PERNODE: