diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-01 22:12:53 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-01 22:12:53 -0400 |
| commit | 3527d3e9514f013f361fba29fd71858d9361049d (patch) | |
| tree | 6c46190e29a05c66b6efdaa9ba7ab2453c4bb51e /arch/ia64 | |
| parent | 3711c94fd6593318146348c940d81040acf9e877 (diff) | |
| parent | 21173d0b4d2a0b9e9e5f3155cf2cfc5781a6f4b1 (diff) | |
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler updates from Ingo Molnar:
"The main changes in this cycle were:
- another round of rq-clock handling debugging, robustization and
fixes
- PELT accounting improvements
- CPU hotplug related ->cpus_allowed affinity handling fixes all
around the tree
- ... plus misc fixes, cleanups and updates"
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (35 commits)
sched/x86: Update reschedule warning text
crypto: N2 - Replace racy task affinity logic
cpufreq/sparc-us2e: Replace racy task affinity logic
cpufreq/sparc-us3: Replace racy task affinity logic
cpufreq/sh: Replace racy task affinity logic
cpufreq/ia64: Replace racy task affinity logic
ACPI/processor: Replace racy task affinity logic
ACPI/processor: Fix error handling in __acpi_processor_start()
sparc/sysfs: Replace racy task affinity logic
powerpc/smp: Replace open coded task affinity logic
ia64/sn/hwperf: Replace racy task affinity logic
ia64/salinfo: Replace racy task affinity logic
workqueue: Provide work_on_cpu_safe()
ia64/topology: Remove cpus_allowed manipulation
sched/fair: Move the PELT constants into a generated header
sched/fair: Increase PELT accuracy for small tasks
sched/fair: Fix comments
sched/Documentation: Add 'sched-pelt' tool
sched/fair: Fix corner case in __accumulate_sum()
sched/core: Remove 'task' parameter and rename tsk_restore_flags() to current_restore_flags()
...
Diffstat (limited to 'arch/ia64')
| -rw-r--r-- | arch/ia64/kernel/salinfo.c | 31 | ||||
| -rw-r--r-- | arch/ia64/kernel/topology.c | 6 | ||||
| -rw-r--r-- | arch/ia64/sn/kernel/sn2/sn_hwperf.c | 17 |
3 files changed, 21 insertions, 33 deletions
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index d194d5c83d32..63dc9cdc95c5 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c | |||
| @@ -179,14 +179,14 @@ struct salinfo_platform_oemdata_parms { | |||
| 179 | const u8 *efi_guid; | 179 | const u8 *efi_guid; |
| 180 | u8 **oemdata; | 180 | u8 **oemdata; |
| 181 | u64 *oemdata_size; | 181 | u64 *oemdata_size; |
| 182 | int ret; | ||
| 183 | }; | 182 | }; |
| 184 | 183 | ||
| 185 | static void | 184 | static long |
| 186 | salinfo_platform_oemdata_cpu(void *context) | 185 | salinfo_platform_oemdata_cpu(void *context) |
| 187 | { | 186 | { |
| 188 | struct salinfo_platform_oemdata_parms *parms = context; | 187 | struct salinfo_platform_oemdata_parms *parms = context; |
| 189 | parms->ret = salinfo_platform_oemdata(parms->efi_guid, parms->oemdata, parms->oemdata_size); | 188 | |
| 189 | return salinfo_platform_oemdata(parms->efi_guid, parms->oemdata, parms->oemdata_size); | ||
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | static void | 192 | static void |
| @@ -380,16 +380,7 @@ salinfo_log_release(struct inode *inode, struct file *file) | |||
| 380 | return 0; | 380 | return 0; |
| 381 | } | 381 | } |
| 382 | 382 | ||
| 383 | static void | 383 | static long |
| 384 | call_on_cpu(int cpu, void (*fn)(void *), void *arg) | ||
| 385 | { | ||
| 386 | cpumask_t save_cpus_allowed = current->cpus_allowed; | ||
| 387 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); | ||
| 388 | (*fn)(arg); | ||
| 389 | set_cpus_allowed_ptr(current, &save_cpus_allowed); | ||
| 390 | } | ||
| 391 | |||
| 392 | static void | ||
| 393 | salinfo_log_read_cpu(void *context) | 384 | salinfo_log_read_cpu(void *context) |
| 394 | { | 385 | { |
| 395 | struct salinfo_data *data = context; | 386 | struct salinfo_data *data = context; |
| @@ -399,6 +390,7 @@ salinfo_log_read_cpu(void *context) | |||
| 399 | /* Clear corrected errors as they are read from SAL */ | 390 | /* Clear corrected errors as they are read from SAL */ |
| 400 | if (rh->severity == sal_log_severity_corrected) | 391 | if (rh->severity == sal_log_severity_corrected) |
| 401 | ia64_sal_clear_state_info(data->type); | 392 | ia64_sal_clear_state_info(data->type); |
| 393 | return 0; | ||
| 402 | } | 394 | } |
| 403 | 395 | ||
| 404 | static void | 396 | static void |
| @@ -430,7 +422,7 @@ retry: | |||
| 430 | spin_unlock_irqrestore(&data_saved_lock, flags); | 422 | spin_unlock_irqrestore(&data_saved_lock, flags); |
| 431 | 423 | ||
| 432 | if (!data->saved_num) | 424 | if (!data->saved_num) |
| 433 | call_on_cpu(cpu, salinfo_log_read_cpu, data); | 425 | work_on_cpu_safe(cpu, salinfo_log_read_cpu, data); |
| 434 | if (!data->log_size) { | 426 | if (!data->log_size) { |
| 435 | data->state = STATE_NO_DATA; | 427 | data->state = STATE_NO_DATA; |
| 436 | cpumask_clear_cpu(cpu, &data->cpu_event); | 428 | cpumask_clear_cpu(cpu, &data->cpu_event); |
| @@ -459,11 +451,13 @@ salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *p | |||
| 459 | return simple_read_from_buffer(buffer, count, ppos, buf, bufsize); | 451 | return simple_read_from_buffer(buffer, count, ppos, buf, bufsize); |
| 460 | } | 452 | } |
| 461 | 453 | ||
| 462 | static void | 454 | static long |
| 463 | salinfo_log_clear_cpu(void *context) | 455 | salinfo_log_clear_cpu(void *context) |
| 464 | { | 456 | { |
| 465 | struct salinfo_data *data = context; | 457 | struct salinfo_data *data = context; |
| 458 | |||
| 466 | ia64_sal_clear_state_info(data->type); | 459 | ia64_sal_clear_state_info(data->type); |
| 460 | return 0; | ||
| 467 | } | 461 | } |
| 468 | 462 | ||
| 469 | static int | 463 | static int |
| @@ -486,7 +480,7 @@ salinfo_log_clear(struct salinfo_data *data, int cpu) | |||
| 486 | rh = (sal_log_record_header_t *)(data->log_buffer); | 480 | rh = (sal_log_record_header_t *)(data->log_buffer); |
| 487 | /* Corrected errors have already been cleared from SAL */ | 481 | /* Corrected errors have already been cleared from SAL */ |
| 488 | if (rh->severity != sal_log_severity_corrected) | 482 | if (rh->severity != sal_log_severity_corrected) |
| 489 | call_on_cpu(cpu, salinfo_log_clear_cpu, data); | 483 | work_on_cpu_safe(cpu, salinfo_log_clear_cpu, data); |
| 490 | /* clearing a record may make a new record visible */ | 484 | /* clearing a record may make a new record visible */ |
| 491 | salinfo_log_new_read(cpu, data); | 485 | salinfo_log_new_read(cpu, data); |
| 492 | if (data->state == STATE_LOG_RECORD) { | 486 | if (data->state == STATE_LOG_RECORD) { |
| @@ -531,9 +525,8 @@ salinfo_log_write(struct file *file, const char __user *buffer, size_t count, lo | |||
| 531 | .oemdata = &data->oemdata, | 525 | .oemdata = &data->oemdata, |
| 532 | .oemdata_size = &data->oemdata_size | 526 | .oemdata_size = &data->oemdata_size |
| 533 | }; | 527 | }; |
| 534 | call_on_cpu(cpu, salinfo_platform_oemdata_cpu, &parms); | 528 | count = work_on_cpu_safe(cpu, salinfo_platform_oemdata_cpu, |
| 535 | if (parms.ret) | 529 | &parms); |
| 536 | count = parms.ret; | ||
| 537 | } else | 530 | } else |
| 538 | data->oemdata_size = 0; | 531 | data->oemdata_size = 0; |
| 539 | } else | 532 | } else |
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index 1a68f012a6dc..d76529cbff20 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c | |||
| @@ -355,18 +355,12 @@ static int cache_add_dev(unsigned int cpu) | |||
| 355 | unsigned long i, j; | 355 | unsigned long i, j; |
| 356 | struct cache_info *this_object; | 356 | struct cache_info *this_object; |
| 357 | int retval = 0; | 357 | int retval = 0; |
| 358 | cpumask_t oldmask; | ||
| 359 | 358 | ||
| 360 | if (all_cpu_cache_info[cpu].kobj.parent) | 359 | if (all_cpu_cache_info[cpu].kobj.parent) |
| 361 | return 0; | 360 | return 0; |
| 362 | 361 | ||
| 363 | oldmask = current->cpus_allowed; | ||
| 364 | retval = set_cpus_allowed_ptr(current, cpumask_of(cpu)); | ||
| 365 | if (unlikely(retval)) | ||
| 366 | return retval; | ||
| 367 | 362 | ||
| 368 | retval = cpu_cache_sysfs_init(cpu); | 363 | retval = cpu_cache_sysfs_init(cpu); |
| 369 | set_cpus_allowed_ptr(current, &oldmask); | ||
| 370 | if (unlikely(retval < 0)) | 364 | if (unlikely(retval < 0)) |
| 371 | return retval; | 365 | return retval; |
| 372 | 366 | ||
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 52704f199dd6..55febd65911a 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c | |||
| @@ -598,12 +598,17 @@ static void sn_hwperf_call_sal(void *info) | |||
| 598 | op_info->ret = r; | 598 | op_info->ret = r; |
| 599 | } | 599 | } |
| 600 | 600 | ||
| 601 | static long sn_hwperf_call_sal_work(void *info) | ||
| 602 | { | ||
| 603 | sn_hwperf_call_sal(info); | ||
| 604 | return 0; | ||
| 605 | } | ||
| 606 | |||
| 601 | static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info) | 607 | static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info) |
| 602 | { | 608 | { |
| 603 | u32 cpu; | 609 | u32 cpu; |
| 604 | u32 use_ipi; | 610 | u32 use_ipi; |
| 605 | int r = 0; | 611 | int r = 0; |
| 606 | cpumask_t save_allowed; | ||
| 607 | 612 | ||
| 608 | cpu = (op_info->a->arg & SN_HWPERF_ARG_CPU_MASK) >> 32; | 613 | cpu = (op_info->a->arg & SN_HWPERF_ARG_CPU_MASK) >> 32; |
| 609 | use_ipi = op_info->a->arg & SN_HWPERF_ARG_USE_IPI_MASK; | 614 | use_ipi = op_info->a->arg & SN_HWPERF_ARG_USE_IPI_MASK; |
| @@ -629,13 +634,9 @@ static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info) | |||
| 629 | /* use an interprocessor interrupt to call SAL */ | 634 | /* use an interprocessor interrupt to call SAL */ |
| 630 | smp_call_function_single(cpu, sn_hwperf_call_sal, | 635 | smp_call_function_single(cpu, sn_hwperf_call_sal, |
| 631 | op_info, 1); | 636 | op_info, 1); |
| 632 | } | 637 | } else { |
| 633 | else { | 638 | /* Call on the target CPU */ |
| 634 | /* migrate the task before calling SAL */ | 639 | work_on_cpu_safe(cpu, sn_hwperf_call_sal_work, op_info); |
| 635 | save_allowed = current->cpus_allowed; | ||
| 636 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); | ||
| 637 | sn_hwperf_call_sal(op_info); | ||
| 638 | set_cpus_allowed_ptr(current, &save_allowed); | ||
| 639 | } | 640 | } |
| 640 | } | 641 | } |
| 641 | r = op_info->ret; | 642 | r = op_info->ret; |
