Skip to content

Commit eda8a2c

Browse files
Sebastian Andrzej SiewiorIngo Molnar
authored andcommitted
perf/x86/intel: Replace deprecated CPU-hotplug functions
The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4f32da7 commit eda8a2c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

arch/x86/events/intel/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5032,9 +5032,9 @@ static ssize_t freeze_on_smi_store(struct device *cdev,
50325032

50335033
x86_pmu.attr_freeze_on_smi = val;
50345034

5035-
get_online_cpus();
5035+
cpus_read_lock();
50365036
on_each_cpu(flip_smm_bit, &val, 1);
5037-
put_online_cpus();
5037+
cpus_read_unlock();
50385038
done:
50395039
mutex_unlock(&freeze_on_smi_mutex);
50405040

@@ -5077,9 +5077,9 @@ static ssize_t set_sysctl_tfa(struct device *cdev,
50775077

50785078
allow_tsx_force_abort = val;
50795079

5080-
get_online_cpus();
5080+
cpus_read_lock();
50815081
on_each_cpu(update_tfa_sched, NULL, 1);
5082-
put_online_cpus();
5082+
cpus_read_unlock();
50835083

50845084
return count;
50855085
}

arch/x86/events/intel/pt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,15 +1708,15 @@ static __init int pt_init(void)
17081708
if (!boot_cpu_has(X86_FEATURE_INTEL_PT))
17091709
return -ENODEV;
17101710

1711-
get_online_cpus();
1711+
cpus_read_lock();
17121712
for_each_online_cpu(cpu) {
17131713
u64 ctl;
17141714

17151715
ret = rdmsrl_safe_on_cpu(cpu, MSR_IA32_RTIT_CTL, &ctl);
17161716
if (!ret && (ctl & RTIT_CTL_TRACEEN))
17171717
prior_warn++;
17181718
}
1719-
put_online_cpus();
1719+
cpus_read_unlock();
17201720

17211721
if (prior_warn) {
17221722
x86_add_exclusive(x86_lbr_exclusive_pt);

0 commit comments

Comments
 (0)