Replace deprecated CPU-hotplug
Subsystems (53)
cover Replace deprecated CPU-hotplug
This is a tree wide replacement of the deprecated CPU hotplug functions which are only wrappers around the actual functions.
Each patch is independent and can be picked up by the relevant maintainer.
Sebastian
PATCH 1/38 Documentation: 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().
Update the documentation accordingly.
--- Documentation/core-api/cpu_hotplug.rst | 2 +- Documentation/trace/ftrace.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/core-api/cpu_hotplug.rst +1 -1
@@ -220,7 +220,7 @@ goes online (offline) and during initial setup (shutdown) of the driver. However each registration and removal function is also available with a ``_nocalls`` suffix which does not invoke the provided callbacks if the invocation of the callbacks is not desired. During the manual setup (or teardown) the functions -``get_online_cpus()`` and ``put_online_cpus()`` should be used to inhibit CPU +``cpus_read_lock()`` and ``cpus_read_unlock()`` should be used to inhibit CPU hotplug operations.
Documentation/trace/ftrace.rst +1 -1
@@ -2762,7 +2762,7 @@ A list of available functions that you can add to these files is put_prev_task_idle kmem_cache_create pick_next_task_rt - get_online_cpus + cpus_read_lock pick_next_task_fair mutex_lock [...]
Signature · 1 line
2.32.0
[tip: smp/core] Documentation: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the smp/core branch of tip:
The following commit has been merged into the smp/core branch of tip:
Commit-ID: c7483d823ee0da31e42d32e51a752f667a059735 Gitweb: https://git.kernel.org/tip/c7483d823ee0da31e42d32e51a752f667a059735 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:44 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sat, 28 Aug 2021 01:46:17 +02:00
Documentation: 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().
Update the documentation accordingly.
--- Documentation/core-api/cpu_hotplug.rst | 2 +- Documentation/trace/ftrace.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/core-api/cpu_hotplug.rst +1 -1
@@ -220,7 +220,7 @@ goes online (offline) and during initial setup (shutdown) of the driver. However each registration and removal function is also available with a ``_nocalls`` suffix which does not invoke the provided callbacks if the invocation of the callbacks is not desired. During the manual setup (or teardown) the functions -``get_online_cpus()`` and ``put_online_cpus()`` should be used to inhibit CPU +``cpus_read_lock()`` and ``cpus_read_unlock()`` should be used to inhibit CPU hotplug operations.
Documentation/trace/ftrace.rst +1 -1
@@ -2762,7 +2762,7 @@ listed in: put_prev_task_idle kmem_cache_create pick_next_task_rt - get_online_cpus + cpus_read_lock pick_next_task_fair mutex_lock [...]
PATCH 2/38 MIPS: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- arch/mips/kernel/mips-mt-fpaff.c | 10 +++++----- arch/mips/kernel/process.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
arch/mips/kernel/mips-mt-fpaff.c +5 -5
@@ -76,13 +76,13 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,if (copy_from_user (&new_mask, user_mask_ptr,sizeof (new_mask)))return -EFAULT ; -get_online_cpus (); +cpus_read_lock ();rcu_read_lock (); p =find_process_by_pid (pid);if (!p) {rcu_read_unlock (); -put_online_cpus (); +cpus_read_unlock ();return -ESRCH ; }
@@ -147,7 +147,7 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,free_cpumask_var (cpus_allowed); out_put_task:put_task_struct (p); -put_online_cpus (); +cpus_read_unlock ();return retval; }
@@ -166,7 +166,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len,if (len < real_len)return -EINVAL ; -get_online_cpus (); +cpus_read_lock ();rcu_read_lock (); retval = -ESRCH ;
@@ -182,7 +182,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, out_unlock:rcu_read_unlock (); -put_online_cpus (); +cpus_read_unlock ();if (retval)return retval;if (copy_to_user (user_mask_ptr, &mask, real_len))
arch/mips/kernel/process.c +2 -2
@@ -859,10 +859,10 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)* scheduled in then it will already have picked up the new FP mode * whilst doing so. */ -get_online_cpus (); +cpus_read_lock ();for_each_cpu_and (cpu, &process_cpus, cpu_online_mask)work_on_cpu (cpu, prepare_for_fp_mode_switch,NULL ); -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
Signature · 1 line
2.32.0
Re: [PATCH 02/38] MIPS: Replace deprecated CPU-hotplug functions.
Quoted 7 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Quoted 7 lines
Cc Thomas Bogendoerfer <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- arch/mips/kernel/mips-mt-fpaff.c | 10 +++++----- arch/mips/kernel/process.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
applied to mips-next.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
PATCH 3/38 powerpc: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- arch/powerpc/kernel/rtasd.c | 4 ++-- arch/powerpc/kvm/book3s_hv_builtin.c | 10 +++++----- arch/powerpc/platforms/powernv/idle.c | 4 ++-- arch/powerpc/platforms/powernv/opal-imc.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-)
arch/powerpc/kernel/rtasd.c +2 -2
@@ -429,7 +429,7 @@ static void rtas_event_scan(struct work_struct *w)do_event_scan (); -get_online_cpus (); +cpus_read_lock ();/* raw_ OK because just using CPU as starting point. */ cpu =cpumask_next (raw_smp_processor_id (), cpu_online_mask);
@@ -451,7 +451,7 @@ static void rtas_event_scan(struct work_struct *w)schedule_delayed_work_on (cpu, &event_scan_work,__round_jiffies_relative (event_scan_delay, cpu)); -put_online_cpus (); +cpus_read_unlock (); }#ifdef CONFIG_PPC64
arch/powerpc/kvm/book3s_hv_builtin.c +5 -5
@@ -137,23 +137,23 @@ long int kvmppc_rm_h_confer(struct kvm_vcpu *vcpu, int target,* exist in the system. We use a counter of VMs to track this. * * One of the operations we need to block is onlining of secondaries, so we -* protect hv_vm_count with get/put_online_cpus(). +* protect hv_vm_count with cpus_read_lock/unlock(). */ static atomic_t hv_vm_count;void kvm_hv_vm_activated (void ) { -get_online_cpus (); +cpus_read_lock ();atomic_inc (&hv_vm_count); -put_online_cpus (); +cpus_read_unlock (); }EXPORT_SYMBOL_GPL (kvm_hv_vm_activated);void kvm_hv_vm_deactivated (void ) { -get_online_cpus (); +cpus_read_lock ();atomic_dec (&hv_vm_count); -put_online_cpus (); +cpus_read_unlock (); }EXPORT_SYMBOL_GPL (kvm_hv_vm_deactivated);
arch/powerpc/platforms/powernv/idle.c +2 -2
@@ -199,12 +199,12 @@ static ssize_t store_fastsleep_workaround_applyonce(struct device *dev,*/ power7_fastsleep_workaround_exit = false; -get_online_cpus (); +cpus_read_lock (); primary_thread_mask =cpu_online_cores_map ();on_each_cpu_mask (&primary_thread_mask, pnv_fastsleep_workaround_apply, &err,1 ); -put_online_cpus (); +cpus_read_unlock ();if (err) {pr_err ("fastsleep_workaround_applyonce change failed while running pnv_fastsleep_workaround_apply" ); goto fail;
arch/powerpc/platforms/powernv/opal-imc.c +4 -4
@@ -186,7 +186,7 @@ static void disable_nest_pmu_counters(void)int nid, cpu;const struct cpumask *l_cpumask; -get_online_cpus (); +cpus_read_lock ();for_each_node_with_cpus (nid) { l_cpumask =cpumask_of_node (nid); cpu =cpumask_first_and (l_cpumask, cpu_online_mask);
@@ -195,7 +195,7 @@ static void disable_nest_pmu_counters(void)opal_imc_counters_stop (OPAL_IMC_COUNTERS_NEST ,get_hard_smp_processor_id (cpu)); } -put_online_cpus (); +cpus_read_unlock (); }static void disable_core_pmu_counters (void )
@@ -203,7 +203,7 @@ static void disable_core_pmu_counters(void)cpumask_t cores_map;int cpu, rc; -get_online_cpus (); +cpus_read_lock ();/* Disable the IMC Core functions */ cores_map =cpu_online_cores_map ();for_each_cpu (cpu, &cores_map) {
@@ -213,7 +213,7 @@ static void disable_core_pmu_counters(void)pr_err ("%s: Failed to stop Core (cpu = %d)\n" , __FUNCTION__, cpu); } -put_online_cpus (); +cpus_read_unlock (); }int get_max_nest_dev (void )
Signature · 1 line
2.32.0
PATCH 4/38 s390: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- arch/s390/hypfs/hypfs_diag0c.c | 10 +++++----- arch/s390/kernel/diag.c | 4 ++-- arch/s390/kernel/irq.c | 4 ++-- arch/s390/kernel/perf_cpum_cf.c | 4 ++-- arch/s390/kernel/processor.c | 4 ++-- arch/s390/kernel/smp.c | 8 ++++---- arch/s390/kernel/topology.c | 4 ++-- arch/s390/mm/maccess.c | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-)
arch/s390/hypfs/hypfs_diag0c.c +5 -5
@@ -33,12 +33,12 @@ static void *diag0c_store(unsigned int *count)unsigned int cpu_count, cpu, i;void **cpu_vec; -get_online_cpus (); +cpus_read_lock (); cpu_count =num_online_cpus (); cpu_vec =kmalloc_array (num_possible_cpus (),sizeof (*cpu_vec),GFP_KERNEL );if (!cpu_vec) - goto fail_put_online_cpus; + goto fail_unlock_cpus;/* Note: Diag 0c needs 8 byte alignment and real storage */ diag0c_data =kzalloc (struct_size (diag0c_data, entry, cpu_count),GFP_KERNEL |GFP_DMA );
@@ -54,13 +54,13 @@ static void *diag0c_store(unsigned int *count)on_each_cpu (diag0c_fn, cpu_vec,1 ); *count = cpu_count;kfree (cpu_vec); -put_online_cpus (); +cpus_read_unlock ();return diag0c_data; fail_kfree_cpu_vec:kfree (cpu_vec); -fail_put_online_cpus: -put_online_cpus (); +fail_unlock_cpus: +cpus_read_unlock ();return ERR_PTR (-ENOMEM ); }
arch/s390/kernel/diag.c +2 -2
@@ -59,7 +59,7 @@ static int show_diag_stat(struct seq_file *m, void *v)unsigned long n = (unsigned long ) v -1 ;int cpu, prec, tmp; -get_online_cpus (); +cpus_read_lock ();if (n ==0 ) {seq_puts (m," " );
@@ -78,7 +78,7 @@ static int show_diag_stat(struct seq_file *m, void *v) }seq_printf (m," %s\n" , diag_map[n-1 ].name); } -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
arch/s390/kernel/irq.c +2 -2
@@ -228,7 +228,7 @@ int show_interrupts(struct seq_file *p, void *v)int index = *(loff_t *) v;int cpu, irq; -get_online_cpus (); +cpus_read_lock ();if (index ==0 ) {seq_puts (p," " );for_each_online_cpu (cpu)
@@ -258,7 +258,7 @@ int show_interrupts(struct seq_file *p, void *v)seq_putc (p,'\n' ); } out: -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
arch/s390/kernel/perf_cpum_cf.c +2 -2
@@ -1138,7 +1138,7 @@ static long cfset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) {int ret; -get_online_cpus (); +cpus_read_lock ();mutex_lock (&cfset_ctrset_mutex);switch (cmd) {case S390_HWCTR_START :
@@ -1155,7 +1155,7 @@ static long cfset_ioctl(struct file *file, unsigned int cmd, unsigned long arg)break ; }mutex_unlock (&cfset_ctrset_mutex); -put_online_cpus (); +cpus_read_unlock ();return ret; }
arch/s390/kernel/processor.c +2 -2
@@ -210,7 +210,7 @@ static inline void *c_update(loff_t *pos)static void *c_start (struct seq_file *m,loff_t *pos) { -get_online_cpus (); +cpus_read_lock ();return c_update (pos); }
@@ -222,7 +222,7 @@ static void *c_next(struct seq_file *m, void *v, loff_t *pos)static void c_stop (struct seq_file *m,void *v) { -put_online_cpus (); +cpus_read_unlock (); }const struct seq_operations cpuinfo_op = {
arch/s390/kernel/smp.c +4 -4
@@ -793,7 +793,7 @@ static int __smp_rescan_cpus(struct sclp_core_info *info, bool early)u16 core_id;int nr, i; -get_online_cpus (); +cpus_read_lock ();mutex_lock (&smp_cpu_state_mutex); nr =0 ;cpumask_xor (&avail, cpu_possible_mask, cpu_present_mask);
@@ -816,7 +816,7 @@ static int __smp_rescan_cpus(struct sclp_core_info *info, bool early) nr +=smp_add_core (&info->core[i], &avail, configured, early); }mutex_unlock (&smp_cpu_state_mutex); -put_online_cpus (); +cpus_read_unlock ();return nr; }
@@ -1055,7 +1055,7 @@ static ssize_t cpu_configure_store(struct device *dev,return -EINVAL ;if (val !=0 && val !=1 )return -EINVAL ; -get_online_cpus (); +cpus_read_lock ();mutex_lock (&smp_cpu_state_mutex); rc = -EBUSY ;/* disallow configuration changes of online cpus and cpu 0 */
@@ -1104,7 +1104,7 @@ static ssize_t cpu_configure_store(struct device *dev, } out:mutex_unlock (&smp_cpu_state_mutex); -put_online_cpus (); +cpus_read_unlock ();return rc ? rc : count; } static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
arch/s390/kernel/topology.c +2 -2
@@ -406,7 +406,7 @@ static ssize_t dispatching_store(struct device *dev,if (val !=0 && val !=1 )return -EINVAL ; rc =0 ; -get_online_cpus (); +cpus_read_lock ();mutex_lock (&smp_cpu_state_mutex);if (cpu_management == val) goto out;
@@ -417,7 +417,7 @@ static ssize_t dispatching_store(struct device *dev,topology_expect_change (); out:mutex_unlock (&smp_cpu_state_mutex); -put_online_cpus (); +cpus_read_unlock ();return rc ? rc : count; }static DEVICE_ATTR_RW (dispatching);
arch/s390/mm/maccess.c +2 -2
@@ -228,7 +228,7 @@ void *xlate_dev_mem_ptr(phys_addr_t addr)void *bounce = (void *) addr;unsigned long size; -get_online_cpus (); +cpus_read_lock ();preempt_disable ();if (is_swapped (addr)) { size =PAGE_SIZE - (addr & ~PAGE_MASK );
@@ -237,7 +237,7 @@ void *xlate_dev_mem_ptr(phys_addr_t addr)memcpy_absolute (bounce, (void *) addr, size); }preempt_enable (); -put_online_cpus (); +cpus_read_unlock ();return bounce; }
Signature · 1 line
2.32.0
Re: [PATCH 04/38] s390: Replace deprecated CPU-hotplug functions.
Quoted 12 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Heiko Carstens <[email protected]>Cc Vasily Gorbik <[email protected]>Cc Christian Borntraeger <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Quoted 10 lines
--- arch/s390/hypfs/hypfs_diag0c.c | 10 +++++----- arch/s390/kernel/diag.c | 4 ++-- arch/s390/kernel/irq.c | 4 ++-- arch/s390/kernel/perf_cpum_cf.c | 4 ++-- arch/s390/kernel/processor.c | 4 ++-- arch/s390/kernel/smp.c | 8 ++++---- arch/s390/kernel/topology.c | 4 ++-- arch/s390/mm/maccess.c | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-)
Applied, thanks!
PATCH 5/38 s390/sclp: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/s390/char/sclp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/char/sclp_config.c +2 -2
@@ -50,12 +50,12 @@ static void sclp_cpu_capability_notify(struct work_struct *work)s390_update_cpu_mhz ();pr_info ("CPU capability may have changed\n" ); -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) { dev =get_cpu_device (cpu);kobject_uevent (&dev->kobj,KOBJ_CHANGE ); } -put_online_cpus (); +cpus_read_unlock (); }static void __ref sclp_cpu_change_notify (struct work_struct *work)
Signature · 1 line
2.32.0
Re: [PATCH 05/38] s390/sclp: Replace deprecated CPU-hotplug functions.
Quoted 7 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Quoted 8 lines
Cc Heiko Carstens <[email protected]>Cc Vasily Gorbik <[email protected]>Cc Christian Borntraeger <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- drivers/s390/char/sclp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks!
PATCH 6/38 x86/mmiotrace: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- arch/x86/mm/mmio-mod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/mm/mmio-mod.c +2 -2
@@ -376,12 +376,12 @@ static void enter_uniprocessor(void) goto out; } -get_online_cpus (); +cpus_read_lock ();cpumask_copy (downed_cpus, cpu_online_mask);cpumask_clear_cpu (cpumask_first (cpu_online_mask), downed_cpus);if (num_online_cpus () >1 )pr_notice ("Disabling non-boot CPUs...\n" ); -put_online_cpus (); +cpus_read_unlock ();for_each_cpu (cpu, downed_cpus) { err =remove_cpu (cpu);
Signature · 1 line
2.32.0
Re: [Nouveau] [PATCH 06/38] x86/mmiotrace: Replace deprecated CPU-hotplug functions.
Quoted 45 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Steven Rostedt <[email protected]>Cc Ingo Molnar <[email protected]>Cc Karol Herbst <[email protected]>Cc Pekka Paalanen <[email protected]>Cc Dave Hansen <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Borislav Petkov <[email protected]>Cc "H. Peter Anvin" <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- arch/x86/mm/mmio-mod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/x86/mm/mmio-mod.c +2
-3@@ -376,12 +376,12 @@ static void enter_uniprocessor(void) goto out; } -get_online_cpus (); +cpus_read_lock ();cpumask_copy (downed_cpus, cpu_online_mask);cpumask_clear_cpu (cpumask_first (cpu_online_mask), downed_cpus);if (num_online_cpus () >1 )pr_notice ("Disabling non-boot CPUs...\n" ); -put_online_cpus (); +cpus_read_unlock ();for_each_cpu (cpu, downed_cpus) { err =remove_cpu (cpu); --
Quoted 2 lines
2.32.0
Re: [PATCH 06/38] x86/mmiotrace: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorQuoted 8 lines · On Tue, 3 Aug 2021 16:15:49 +0200 Sebastian Andrzej Siewior…
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Steven Rostedt <[email protected]>
-- Steve
Quoted 35 lines
Cc Ingo Molnar <[email protected]>Cc Karol Herbst <[email protected]>Cc Pekka Paalanen <[email protected]>Cc Dave Hansen <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Borislav Petkov <[email protected]>Cc "H. Peter Anvin" <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- arch/x86/mm/mmio-mod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/x86/mm/mmio-mod.c +2
-2@@ -376,12 +376,12 @@ static void enter_uniprocessor(void) goto out; } -get_online_cpus (); +cpus_read_lock ();cpumask_copy (downed_cpus, cpu_online_mask);cpumask_clear_cpu (cpumask_first (cpu_online_mask), downed_cpus);if (num_online_cpus () >1 )pr_notice ("Disabling non-boot CPUs...\n" ); -put_online_cpus (); +cpus_read_unlock ();for_each_cpu (cpu, downed_cpus) { err =remove_cpu (cpu);
[tip: x86/cleanups] x86/mmiotrace: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe following commit has been merged into the x86/cleanups branch of tip:
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 77ad320cfb2ac172eeba32a77a388281b003ec17 Gitweb: https://git.kernel.org/tip/77ad320cfb2ac172eeba32a77a388281b003ec17 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:49 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 14:46:27 +02:00
x86/mmiotrace: 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.
--- arch/x86/mm/mmio-mod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/mm/mmio-mod.c +2 -2
@@ -376,12 +376,12 @@ static void enter_uniprocessor(void) goto out; } -get_online_cpus (); +cpus_read_lock ();cpumask_copy (downed_cpus, cpu_online_mask);cpumask_clear_cpu (cpumask_first (cpu_online_mask), downed_cpus);if (num_online_cpus () >1 )pr_notice ("Disabling non-boot CPUs...\n" ); -put_online_cpus (); +cpus_read_unlock ();for_each_cpu (cpu, downed_cpus) { err =remove_cpu (cpu);
PATCH 7/38 x86/mtrr: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- arch/x86/kernel/cpu/mtrr/mtrr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mtrr/mtrr.c +4 -4
@@ -336,7 +336,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, replace =-1 ;/* No CPU hotplug when we change MTRR entries */ -get_online_cpus (); +cpus_read_lock ();/* Search for existing MTRR */ mutex_lock (&mtrr_mutex);
@@ -398,7 +398,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, error = i; out:mutex_unlock (&mtrr_mutex); -put_online_cpus (); +cpus_read_unlock ();return error; }
@@ -485,7 +485,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) max = num_var_ranges;/* No CPU hotplug when we change MTRR entries */ -get_online_cpus (); +cpus_read_lock ();mutex_lock (&mtrr_mutex);if (reg <0 ) {/* Search for existing MTRR */
@@ -520,7 +520,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) error = reg; out:mutex_unlock (&mtrr_mutex); -put_online_cpus (); +cpus_read_unlock ();return error; }
Signature · 1 line
2.32.0
[tip: x86/cleanups] x86/mtrr: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the x86/cleanups branch of tip:
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 1a351eefd4acc97145903b1c07e4d8b626854b82 Gitweb: https://git.kernel.org/tip/1a351eefd4acc97145903b1c07e4d8b626854b82 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:50 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 14:46:27 +02:00
x86/mtrr: 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.
--- arch/x86/kernel/cpu/mtrr/mtrr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mtrr/mtrr.c +4 -4
@@ -336,7 +336,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, replace =-1 ;/* No CPU hotplug when we change MTRR entries */ -get_online_cpus (); +cpus_read_lock ();/* Search for existing MTRR */ mutex_lock (&mtrr_mutex);
@@ -398,7 +398,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, error = i; out:mutex_unlock (&mtrr_mutex); -put_online_cpus (); +cpus_read_unlock ();return error; }
@@ -485,7 +485,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) max = num_var_ranges;/* No CPU hotplug when we change MTRR entries */ -get_online_cpus (); +cpus_read_lock ();mutex_lock (&mtrr_mutex);if (reg <0 ) {/* Search for existing MTRR */
@@ -520,7 +520,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) error = reg; out:mutex_unlock (&mtrr_mutex); -put_online_cpus (); +cpus_read_unlock ();return error; }
PATCH 8/38 x86/microcode: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- arch/x86/kernel/cpu/microcode/core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/x86/kernel/cpu/microcode/core.c +9 -9
@@ -55,7 +55,7 @@ LIST_HEAD(microcode_cache);* All non cpu-hotplug-callback call sites use: * * - microcode_mutex to synchronize with each other; -* - get/put_online_cpus() to synchronize with +* - cpus_read_lock/unlock() to synchronize with * the cpu-hotplug-callback call sites. * * We guarantee that only a single cpu is being
@@ -431,7 +431,7 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,return ret; } -get_online_cpus (); +cpus_read_lock ();mutex_lock (µcode_mutex);if (do_microcode_update (buf, len) ==0 )
@@ -441,7 +441,7 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,perf_check_microcode ();mutex_unlock (µcode_mutex); -put_online_cpus (); +cpus_read_unlock ();return ret; }
@@ -629,7 +629,7 @@ static ssize_t reload_store(struct device *dev,if (val !=1 )return size; -get_online_cpus (); +cpus_read_lock (); ret =check_online_cpus ();if (ret)
@@ -644,7 +644,7 @@ static ssize_t reload_store(struct device *dev,mutex_unlock (µcode_mutex); put: -put_online_cpus (); +cpus_read_unlock ();if (ret ==0 ) ret = size;
@@ -853,14 +853,14 @@ static int __init microcode_init(void)if (IS_ERR (microcode_pdev))return PTR_ERR (microcode_pdev); -get_online_cpus (); +cpus_read_lock ();mutex_lock (µcode_mutex); error =subsys_interface_register (&mc_cpu_interface);if (!error)perf_check_microcode ();mutex_unlock (µcode_mutex); -put_online_cpus (); +cpus_read_unlock ();if (error) goto out_pdev;
@@ -892,13 +892,13 @@ static int __init microcode_init(void) &cpu_root_microcode_group); out_driver: -get_online_cpus (); +cpus_read_lock ();mutex_lock (µcode_mutex);subsys_interface_unregister (&mc_cpu_interface);mutex_unlock (µcode_mutex); -put_online_cpus (); +cpus_read_unlock (); out_pdev:platform_device_unregister (microcode_pdev);
Signature · 1 line
2.32.0
[tip: x86/cleanups] x86/microcode: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the x86/cleanups branch of tip:
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 2089f34f8c5b91f7235023ec72e71e3247261ecc Gitweb: https://git.kernel.org/tip/2089f34f8c5b91f7235023ec72e71e3247261ecc Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:51 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 14:46:27 +02:00
x86/microcode: 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.
--- arch/x86/kernel/cpu/microcode/core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/x86/kernel/cpu/microcode/core.c +9 -9
@@ -55,7 +55,7 @@ LIST_HEAD(microcode_cache);* All non cpu-hotplug-callback call sites use: * * - microcode_mutex to synchronize with each other; -* - get/put_online_cpus() to synchronize with +* - cpus_read_lock/unlock() to synchronize with * the cpu-hotplug-callback call sites. * * We guarantee that only a single cpu is being
@@ -431,7 +431,7 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,return ret; } -get_online_cpus (); +cpus_read_lock ();mutex_lock (µcode_mutex);if (do_microcode_update (buf, len) ==0 )
@@ -441,7 +441,7 @@ static ssize_t microcode_write(struct file *file, const char __user *buf,perf_check_microcode ();mutex_unlock (µcode_mutex); -put_online_cpus (); +cpus_read_unlock ();return ret; }
@@ -629,7 +629,7 @@ static ssize_t reload_store(struct device *dev,if (val !=1 )return size; -get_online_cpus (); +cpus_read_lock (); ret =check_online_cpus ();if (ret)
@@ -644,7 +644,7 @@ static ssize_t reload_store(struct device *dev,mutex_unlock (µcode_mutex); put: -put_online_cpus (); +cpus_read_unlock ();if (ret ==0 ) ret = size;
@@ -853,14 +853,14 @@ static int __init microcode_init(void)if (IS_ERR (microcode_pdev))return PTR_ERR (microcode_pdev); -get_online_cpus (); +cpus_read_lock ();mutex_lock (µcode_mutex); error =subsys_interface_register (&mc_cpu_interface);if (!error)perf_check_microcode ();mutex_unlock (µcode_mutex); -put_online_cpus (); +cpus_read_unlock ();if (error) goto out_pdev;
@@ -892,13 +892,13 @@ static int __init microcode_init(void) &cpu_root_microcode_group); out_driver: -get_online_cpus (); +cpus_read_lock ();mutex_lock (µcode_mutex);subsys_interface_unregister (&mc_cpu_interface);mutex_unlock (µcode_mutex); -put_online_cpus (); +cpus_read_unlock (); out_pdev:platform_device_unregister (microcode_pdev);
PATCH 9/38 x86/mce/inject: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- arch/x86/kernel/cpu/mce/inject.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mce/inject.c +4 -4
@@ -235,7 +235,7 @@ static void __maybe_unused raise_mce(struct mce *m)unsigned long start;int cpu; -get_online_cpus (); +cpus_read_lock ();cpumask_copy (mce_inject_cpumask, cpu_online_mask);cpumask_clear_cpu (get_cpu (), mce_inject_cpumask);for_each_online_cpu (cpu) {
@@ -269,7 +269,7 @@ static void __maybe_unused raise_mce(struct mce *m) }raise_local ();put_cpu (); -put_online_cpus (); +cpus_read_unlock (); }else {preempt_disable ();raise_local ();
@@ -529,7 +529,7 @@ static void do_inject(void) cpu =get_nbc_for_node (topology_die_id (cpu)); } -get_online_cpus (); +cpus_read_lock ();if (!cpu_online (cpu)) goto err;
@@ -553,7 +553,7 @@ static void do_inject(void) } err: -put_online_cpus (); +cpus_read_unlock (); }
Signature · 1 line
2.32.0
[tip: x86/cleanups] x86/mce/inject: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the x86/cleanups branch of tip:
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 8ae9e3f63865bc067c144817da9df025dbb667f2 Gitweb: https://git.kernel.org/tip/8ae9e3f63865bc067c144817da9df025dbb667f2 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:52 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 14:46:27 +02:00
x86/mce/inject: 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.
--- arch/x86/kernel/cpu/mce/inject.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mce/inject.c +4 -4
@@ -235,7 +235,7 @@ static void __maybe_unused raise_mce(struct mce *m)unsigned long start;int cpu; -get_online_cpus (); +cpus_read_lock ();cpumask_copy (mce_inject_cpumask, cpu_online_mask);cpumask_clear_cpu (get_cpu (), mce_inject_cpumask);for_each_online_cpu (cpu) {
@@ -269,7 +269,7 @@ static void __maybe_unused raise_mce(struct mce *m) }raise_local ();put_cpu (); -put_online_cpus (); +cpus_read_unlock (); }else {preempt_disable ();raise_local ();
@@ -529,7 +529,7 @@ static void do_inject(void) cpu =get_nbc_for_node (topology_die_id (cpu)); } -get_online_cpus (); +cpus_read_lock ();if (!cpu_online (cpu)) goto err;
@@ -553,7 +553,7 @@ static void do_inject(void) } err: -put_online_cpus (); +cpus_read_unlock (); }
PATCH 10/38 perf/x86/intel: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- arch/x86/events/intel/core.c | 8 ++++---- arch/x86/events/intel/pt.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/x86/events/intel/core.c +4 -4
@@ -5026,9 +5026,9 @@ static ssize_t freeze_on_smi_store(struct device *cdev, x86_pmu.attr_freeze_on_smi = val; -get_online_cpus (); +cpus_read_lock ();on_each_cpu (flip_smm_bit, &val,1 ); -put_online_cpus (); +cpus_read_unlock (); done:mutex_unlock (&freeze_on_smi_mutex);
@@ -5071,9 +5071,9 @@ static ssize_t set_sysctl_tfa(struct device *cdev, allow_tsx_force_abort = val; -get_online_cpus (); +cpus_read_lock ();on_each_cpu (update_tfa_sched,NULL ,1 ); -put_online_cpus (); +cpus_read_unlock ();return count; }
arch/x86/events/intel/pt.c +2 -2
@@ -1708,7 +1708,7 @@ static __init int pt_init(void)if (!boot_cpu_has (X86_FEATURE_INTEL_PT ))return -ENODEV ; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {u64 ctl;
@@ -1716,7 +1716,7 @@ static __init int pt_init(void)if (!ret && (ctl &RTIT_CTL_TRACEEN )) prior_warn++; } -put_online_cpus (); +cpus_read_unlock ();if (prior_warn) {x86_add_exclusive (x86_lbr_exclusive_pt);
Signature · 1 line
2.32.0
[tip: perf/core] perf/x86/intel: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 4db0d3d3eeb8e15fce529480e4e99a3776f69604 Gitweb: https://git.kernel.org/tip/4db0d3d3eeb8e15fce529480e4e99a3776f69604 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:53 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 15:00:26 +02:00
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.
--- arch/x86/events/intel/core.c | 8 ++++---- arch/x86/events/intel/pt.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/x86/events/intel/core.c +4 -4
@@ -5026,9 +5026,9 @@ static ssize_t freeze_on_smi_store(struct device *cdev, x86_pmu.attr_freeze_on_smi = val; -get_online_cpus (); +cpus_read_lock ();on_each_cpu (flip_smm_bit, &val,1 ); -put_online_cpus (); +cpus_read_unlock (); done:mutex_unlock (&freeze_on_smi_mutex);
@@ -5071,9 +5071,9 @@ static ssize_t set_sysctl_tfa(struct device *cdev, allow_tsx_force_abort = val; -get_online_cpus (); +cpus_read_lock ();on_each_cpu (update_tfa_sched,NULL ,1 ); -put_online_cpus (); +cpus_read_unlock ();return count; }
arch/x86/events/intel/pt.c +2 -2
@@ -1708,7 +1708,7 @@ static __init int pt_init(void)if (!boot_cpu_has (X86_FEATURE_INTEL_PT ))return -ENODEV ; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {u64 ctl;
@@ -1716,7 +1716,7 @@ static __init int pt_init(void)if (!ret && (ctl &RTIT_CTL_TRACEEN )) prior_warn++; } -put_online_cpus (); +cpus_read_unlock ();if (prior_warn) {x86_add_exclusive (x86_lbr_exclusive_pt);
[tip: perf/core] perf/x86/intel: Replace deprecated CPU-hotplug functions
In reply to Sebastian Andrzej SiewiorThe following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: eda8a2c599d1ff874a63de7684b430740e747dea Gitweb: https://git.kernel.org/tip/eda8a2c599d1ff874a63de7684b430740e747dea Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:53 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Thu, 26 Aug 2021 09:14:36 +02:00
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.
--- arch/x86/events/intel/core.c | 8 ++++---- arch/x86/events/intel/pt.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/x86/events/intel/core.c +4 -4
@@ -5032,9 +5032,9 @@ static ssize_t freeze_on_smi_store(struct device *cdev, x86_pmu.attr_freeze_on_smi = val; -get_online_cpus (); +cpus_read_lock ();on_each_cpu (flip_smm_bit, &val,1 ); -put_online_cpus (); +cpus_read_unlock (); done:mutex_unlock (&freeze_on_smi_mutex);
@@ -5077,9 +5077,9 @@ static ssize_t set_sysctl_tfa(struct device *cdev, allow_tsx_force_abort = val; -get_online_cpus (); +cpus_read_lock ();on_each_cpu (update_tfa_sched,NULL ,1 ); -put_online_cpus (); +cpus_read_unlock ();return count; }
arch/x86/events/intel/pt.c +2 -2
@@ -1708,7 +1708,7 @@ static __init int pt_init(void)if (!boot_cpu_has (X86_FEATURE_INTEL_PT ))return -ENODEV ; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {u64 ctl;
@@ -1716,7 +1716,7 @@ static __init int pt_init(void)if (!ret && (ctl &RTIT_CTL_TRACEEN )) prior_warn++; } -put_online_cpus (); +cpus_read_unlock ();if (prior_warn) {x86_add_exclusive (x86_lbr_exclusive_pt);
PATCH 11/38 perf/hw_breakpoint: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/events/hw_breakpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/hw_breakpoint.c +2 -2
@@ -568,7 +568,7 @@ register_wide_hw_breakpoint(struct perf_event_attr *attr,if (!cpu_events)return (void __percpu __force *)ERR_PTR (-ENOMEM ); -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) { bp =perf_event_create_kernel_counter (attr, cpu,NULL , triggered, context);
@@ -579,7 +579,7 @@ register_wide_hw_breakpoint(struct perf_event_attr *attr,per_cpu (*cpu_events, cpu) = bp; } -put_online_cpus (); +cpus_read_unlock ();if (likely (!err))return cpu_events;
Signature · 1 line
2.32.0
[tip: perf/core] perf/hw_breakpoint: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: b28a32083bfa485f516c8b08c5d6050ff5aef3fb Gitweb: https://git.kernel.org/tip/b28a32083bfa485f516c8b08c5d6050ff5aef3fb Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:54 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 15:00:26 +02:00
perf/hw_breakpoint: 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.
--- kernel/events/hw_breakpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/hw_breakpoint.c +2 -2
@@ -568,7 +568,7 @@ register_wide_hw_breakpoint(struct perf_event_attr *attr,if (!cpu_events)return (void __percpu __force *)ERR_PTR (-ENOMEM ); -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) { bp =perf_event_create_kernel_counter (attr, cpu,NULL , triggered, context);
@@ -579,7 +579,7 @@ register_wide_hw_breakpoint(struct perf_event_attr *attr,per_cpu (*cpu_events, cpu) = bp; } -put_online_cpus (); +cpus_read_unlock ();if (likely (!err))return cpu_events;
[tip: perf/core] perf/hw_breakpoint: Replace deprecated CPU-hotplug functions
In reply to Sebastian Andrzej SiewiorThe following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: ffec09f9c7d7b21b0aff29dd5c3972f4631c0b6b Gitweb: https://git.kernel.org/tip/ffec09f9c7d7b21b0aff29dd5c3972f4631c0b6b Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:54 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Thu, 26 Aug 2021 09:14:36 +02:00
perf/hw_breakpoint: 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.
--- kernel/events/hw_breakpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/hw_breakpoint.c +2 -2
@@ -568,7 +568,7 @@ register_wide_hw_breakpoint(struct perf_event_attr *attr,if (!cpu_events)return (void __percpu __force *)ERR_PTR (-ENOMEM ); -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) { bp =perf_event_create_kernel_counter (attr, cpu,NULL , triggered, context);
@@ -579,7 +579,7 @@ register_wide_hw_breakpoint(struct perf_event_attr *attr,per_cpu (*cpu_events, cpu) = bp; } -put_online_cpus (); +cpus_read_unlock ();if (likely (!err))return cpu_events;
PATCH 12/38 crypto: virtio: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/crypto/virtio/virtio_crypto_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/virtio/virtio_crypto_core.c +2 -2
@@ -187,9 +187,9 @@ static int virtcrypto_init_vqs(struct virtio_crypto *vi)if (ret) goto err_free; -get_online_cpus (); +cpus_read_lock ();virtcrypto_set_affinity (vi); -put_online_cpus (); +cpus_read_unlock ();return 0 ;
Signature · 1 line
2.32.0
Herbert Xu
maintainerRe: [PATCH 12/38] crypto: virtio: Replace deprecated CPU-hotplug functions.
Quoted 15 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Gonglei <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Jason Wang <[email protected]>Cc Herbert Xu <[email protected]>Cc "David S. Miller" <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Quoted 3 lines
--- drivers/crypto/virtio/virtio_crypto_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
PATCH 13/38 hwmon: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/hwmon/dell-smm-hwmon.c | 4 ++-- drivers/hwmon/fam15h_power.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/dell-smm-hwmon.c +2 -2
@@ -228,9 +228,9 @@ static int i8k_smm(struct smm_regs *regs) {int ret; -get_online_cpus (); +cpus_read_lock (); ret =smp_call_on_cpu (0 , i8k_smm_func, regs, true); -put_online_cpus (); +cpus_read_unlock ();return ret; }
drivers/hwmon/fam15h_power.c +2 -2
@@ -166,7 +166,7 @@ static int read_registers(struct fam15h_power_data *data)memset (data->cu_on,0 ,sizeof (int ) *MAX_CUS ); -get_online_cpus (); +cpus_read_lock ();/* * Choose the first online core of each compute unit, and then
@@ -190,7 +190,7 @@ static int read_registers(struct fam15h_power_data *data)on_each_cpu_mask (mask, do_read_registers_on_cu, data, true); -put_online_cpus (); +cpus_read_unlock ();free_cpumask_var (mask);return 0 ;
Signature · 1 line
2.32.0
Re: [PATCH 13/38] hwmon: Replace deprecated CPU-hotplug functions.
Quoted 11 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Jean Delvare <[email protected]>Cc Guenter Roeck <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Applied.
Thanks,
Guenter
Quoted 43 lines
--- drivers/hwmon/dell-smm-hwmon.c | 4 ++-- drivers/hwmon/fam15h_power.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/hwmon/dell-smm-hwmon.c +2
-2@@ -228,9 +228,9 @@ static int i8k_smm(struct smm_regs *regs) {int ret; -get_online_cpus (); +cpus_read_lock (); ret =smp_call_on_cpu (0 , i8k_smm_func, regs, true); -put_online_cpus (); +cpus_read_unlock ();return ret; }drivers/hwmon/fam15h_power.c +2
-2@@ -166,7 +166,7 @@ static int read_registers(struct fam15h_power_data *data)memset (data->cu_on,0 ,sizeof (int ) *MAX_CUS ); -get_online_cpus (); +cpus_read_lock ();/* * Choose the first online core of each compute unit, and then @@ -190,7 +190,7 @@ static int read_registers(struct fam15h_power_data *data)on_each_cpu_mask (mask, do_read_registers_on_cu, data, true); -put_online_cpus (); +cpus_read_unlock ();free_cpumask_var (mask);return 0 ;
PATCH 14/38 coresight: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/hwtracing/coresight/coresight-cpu-debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwtracing/coresight/coresight-cpu-debug.c +2 -2
@@ -588,11 +588,11 @@ static int debug_probe(struct amba_device *adev, const struct amba_id *id) drvdata->base = base; -get_online_cpus (); +cpus_read_lock ();per_cpu (debug_drvdata, drvdata->cpu) = drvdata; ret =smp_call_function_single (drvdata->cpu, debug_init_arch_data, drvdata,1 ); -put_online_cpus (); +cpus_read_unlock ();if (ret) {dev_err (dev,"CPU%d debug arch init failed\n" , drvdata->cpu);
Signature · 1 line
2.32.0
Re: [PATCH 14/38] coresight: Replace deprecated CPU-hotplug functions.
Quoted 25 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Mathieu Poirier <[email protected]>Cc Suzuki K Poulose <[email protected]>Cc Mike Leach <[email protected]>Cc Leo Yan <[email protected]>Cc Alexander Shishkin <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- drivers/hwtracing/coresight/coresight-cpu-debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/hwtracing/coresight/coresight-cpu-debug.c +0
-0@@ -588,11 +588,11 @@ static int debug_probe(struct amba_device *adev, const struct amba_id *id)
drivers/hwtracing/coresight/coresight-cpu-debug.c static int debug_probe(struct amba_device *adev, const struct amba_id *id) · line 596
Quoted 10 lines
drivers/hwtracing/coresight/coresight-cpu-debug.c +2
-2drvdata->base = base; -get_online_cpus (); +cpus_read_lock ();per_cpu (debug_drvdata, drvdata->cpu) = drvdata; ret =smp_call_function_single (drvdata->cpu, debug_init_arch_data, drvdata,1 ); -put_online_cpus (); +cpus_read_unlock ();
Applied - thanks,
Mathieu
Quoted 5 lines
drivers/hwtracing/coresight/coresight-cpu-debug.c +0
-0if (ret) {dev_err (dev,"CPU%d debug arch init failed\n" , drvdata->cpu);Signature · 1 line
2.32.0
PATCH 15/38 md/raid5: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/md/raid5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/raid5.c +2 -2
@@ -2437,7 +2437,7 @@ static int resize_chunks(struct r5conf *conf, int new_disks, int new_sectors) conf->scribble_sectors >= new_sectors)return 0 ;mddev_suspend (conf->mddev); -get_online_cpus (); +cpus_read_lock ();for_each_present_cpu (cpu) {struct raid5_percpu *percpu;
@@ -2449,7 +2449,7 @@ static int resize_chunks(struct r5conf *conf, int new_disks, int new_sectors)break ; } -put_online_cpus (); +cpus_read_unlock ();mddev_resume (conf->mddev);if (!err) { conf->scribble_disks = new_disks;
Signature · 1 line
2.32.0
Re: [PATCH 15/38] md/raid5: Replace deprecated CPU-hotplug functions.
Quoted 11 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Song Liu <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
[tip: smp/core] md/raid5: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe following commit has been merged into the smp/core branch of tip:
The following commit has been merged into the smp/core branch of tip:
Commit-ID: 252034e03f04e54acfb5f5924dd26ae638e3215e Gitweb: https://git.kernel.org/tip/252034e03f04e54acfb5f5924dd26ae638e3215e Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:15:58 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sat, 28 Aug 2021 01:46:17 +02:00
md/raid5: 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.
--- drivers/md/raid5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/raid5.c +2 -2
@@ -2437,7 +2437,7 @@ static int resize_chunks(struct r5conf *conf, int new_disks, int new_sectors) conf->scribble_sectors >= new_sectors)return 0 ;mddev_suspend (conf->mddev); -get_online_cpus (); +cpus_read_lock ();for_each_present_cpu (cpu) {struct raid5_percpu *percpu;
@@ -2449,7 +2449,7 @@ static int resize_chunks(struct r5conf *conf, int new_disks, int new_sectors)break ; } -put_online_cpus (); +cpus_read_unlock ();mddev_resume (conf->mddev);if (!err) { conf->scribble_disks = new_disks;
PATCH 16/38 sgi-xpc: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/misc/sgi-xp/xpc_uv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/misc/sgi-xp/xpc_uv.c +4 -4
@@ -1742,7 +1742,7 @@ xpc_init_mq_node(int nid) {int cpu; -get_online_cpus (); +cpus_read_lock ();for_each_cpu (cpu,cpumask_of_node (nid)) { xpc_activate_mq_uv =
@@ -1753,7 +1753,7 @@ xpc_init_mq_node(int nid)break ; }if (IS_ERR (xpc_activate_mq_uv)) { -put_online_cpus (); +cpus_read_unlock ();return PTR_ERR (xpc_activate_mq_uv); }
@@ -1767,11 +1767,11 @@ xpc_init_mq_node(int nid) }if (IS_ERR (xpc_notify_mq_uv)) {xpc_destroy_gru_mq_uv (xpc_activate_mq_uv); -put_online_cpus (); +cpus_read_unlock ();return PTR_ERR (xpc_notify_mq_uv); } -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
Signature · 1 line
2.32.0
Re: [PATCH 16/38] sgi-xpc: Replace deprecated CPU-hotplug functions.
Quoted 56 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Robin Holt <[email protected]>Cc Steve Wahl <[email protected]>Cc Mike Travis <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- drivers/misc/sgi-xp/xpc_uv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/misc/sgi-xp/xpc_uv.c +4
-4@@ -1742,7 +1742,7 @@ xpc_init_mq_node(int nid) {int cpu; -get_online_cpus (); +cpus_read_lock ();for_each_cpu (cpu,cpumask_of_node (nid)) { xpc_activate_mq_uv =@@ -1753,7 +1753,7 @@ xpc_init_mq_node(int nid)break ; }if (IS_ERR (xpc_activate_mq_uv)) { -put_online_cpus (); +cpus_read_unlock ();return PTR_ERR (xpc_activate_mq_uv); }@@ -1767,11 +1767,11 @@ xpc_init_mq_node(int nid) }if (IS_ERR (xpc_notify_mq_uv)) {xpc_destroy_gru_mq_uv (xpc_activate_mq_uv); -put_online_cpus (); +cpus_read_unlock ();return PTR_ERR (xpc_notify_mq_uv); } -put_online_cpus (); +cpus_read_unlock ();return 0 ; }Signature · 1 line
2.32.0
Signature · 1 line
Steve Wahl, Hewlett Packard Enterprise
Re: [PATCH 16/38] sgi-xpc: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorQuoted 1 line
Signed-off-by Sebastian Andrzej Siewior <[email protected]>
PATCH 17/38 platform/x86: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/platform/x86/dell/dcdbas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/dell/dcdbas.c +2 -2
@@ -278,9 +278,9 @@ int dcdbas_smi_request(struct smi_cmd *smi_cmd) }/* SMI requires CPU 0 */ -get_online_cpus (); +cpus_read_lock (); ret =smp_call_on_cpu (0 , raise_smi, smi_cmd, true); -put_online_cpus (); +cpus_read_unlock ();return ret; }
Signature · 1 line
2.32.0
Re: [PATCH 17/38] platform/x86: Replace deprecated CPU-hotplug functions.
Hi,
Quoted 4 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().
Quoted 8 lines
Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Stuart Hayes <[email protected]>Cc Hans de Goede <[email protected]>Cc Mark Gross <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Thank you for your patch, I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.
Regards,
Hans
Quoted 21 lines
--- drivers/platform/x86/dell/dcdbas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/platform/x86/dell/dcdbas.c +2
-2@@ -278,9 +278,9 @@ int dcdbas_smi_request(struct smi_cmd *smi_cmd) }/* SMI requires CPU 0 */ -get_online_cpus (); +cpus_read_lock (); ret =smp_call_on_cpu (0 , raise_smi, smi_cmd, true); -put_online_cpus (); +cpus_read_unlock ();return ret; }
PATCH 18/38 powercap: intel_rapl: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/powercap/intel_rapl_common.c | 50 ++++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-)
drivers/powercap/intel_rapl_common.c +25 -25
@@ -158,16 +158,16 @@ static int get_energy_counter(struct powercap_zone *power_zone,/* prevent CPU hotplug, make sure the RAPL domain does not go * away while reading the counter. */ -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone);if (!rapl_read_data_raw (rd,ENERGY_COUNTER , true, &energy_now)) { *energy_raw = energy_now; -put_online_cpus (); +cpus_read_unlock ();return 0 ; } -put_online_cpus (); +cpus_read_unlock ();return -EIO ; }
@@ -216,11 +216,11 @@ static int set_domain_enable(struct powercap_zone *power_zone, bool mode)if (rd->state &DOMAIN_STATE_BIOS_LOCKED )return -EACCES ; -get_online_cpus (); +cpus_read_lock ();rapl_write_data_raw (rd,PL1_ENABLE , mode);if (rapl_defaults->set_floor_freq) rapl_defaults->set_floor_freq (rd, mode); -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
@@ -234,13 +234,13 @@ static int get_domain_enable(struct powercap_zone *power_zone, bool *mode) *mode = false;return 0 ; } -get_online_cpus (); +cpus_read_lock ();if (rapl_read_data_raw (rd,PL1_ENABLE , true, &val)) { -put_online_cpus (); +cpus_read_unlock ();return -EIO ; } *mode = val; -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
@@ -317,7 +317,7 @@ static int set_power_limit(struct powercap_zone *power_zone, int cid,int ret =0 ;int id; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone); id =contraint_to_pl (rd, cid);if (id <0 ) {
@@ -350,7 +350,7 @@ static int set_power_limit(struct powercap_zone *power_zone, int cid,if (!ret)package_power_limit_irq_save (rp); set_exit: -put_online_cpus (); +cpus_read_unlock ();return ret; }
@@ -363,7 +363,7 @@ static int get_current_power_limit(struct powercap_zone *power_zone, int cid,int ret =0 ;int id; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone); id =contraint_to_pl (rd, cid);if (id <0 ) {
@@ -382,7 +382,7 @@ static int get_current_power_limit(struct powercap_zone *power_zone, int cid, prim =POWER_LIMIT4 ;break ;default : -put_online_cpus (); +cpus_read_unlock ();return -EINVAL ; }if (rapl_read_data_raw (rd, prim, true, &val))
@@ -391,7 +391,7 @@ static int get_current_power_limit(struct powercap_zone *power_zone, int cid, *data = val; get_exit: -put_online_cpus (); +cpus_read_unlock ();return ret; }
@@ -403,7 +403,7 @@ static int set_time_window(struct powercap_zone *power_zone, int cid,int ret =0 ;int id; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone); id =contraint_to_pl (rd, cid);if (id <0 ) {
@@ -423,7 +423,7 @@ static int set_time_window(struct powercap_zone *power_zone, int cid, } set_time_exit: -put_online_cpus (); +cpus_read_unlock ();return ret; }
@@ -435,7 +435,7 @@ static int get_time_window(struct powercap_zone *power_zone, int cid,int ret =0 ;int id; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone); id =contraint_to_pl (rd, cid);if (id <0 ) {
@@ -458,14 +458,14 @@ static int get_time_window(struct powercap_zone *power_zone, int cid, val =0 ;break ;default : -put_online_cpus (); +cpus_read_unlock ();return -EINVAL ; }if (!ret) *data = val; get_time_exit: -put_online_cpus (); +cpus_read_unlock ();return ret; }
@@ -491,7 +491,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id, u64 *data)int prim;int ret =0 ; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone);switch (rd->rpl[id].prim_id) {case PL1_ENABLE :
@@ -504,7 +504,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id, u64 *data) prim =MAX_POWER ;break ;default : -put_online_cpus (); +cpus_read_unlock ();return -EINVAL ; }if (rapl_read_data_raw (rd, prim, true, &val))
@@ -516,7 +516,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id, u64 *data)if (rd->rpl[id].prim_id ==PL4_ENABLE ) *data = *data *2 ; -put_online_cpus (); +cpus_read_unlock ();return ret; }
@@ -1358,7 +1358,7 @@ static void power_limit_state_save(void)struct rapl_domain *rd;int nr_pl, ret, i; -get_online_cpus (); +cpus_read_lock ();list_for_each_entry (rp, &rapl_packages, plist) {if (!rp->power_zone)continue ;
@@ -1390,7 +1390,7 @@ static void power_limit_state_save(void) } } } -put_online_cpus (); +cpus_read_unlock (); }static void power_limit_state_restore (void )
@@ -1399,7 +1399,7 @@ static void power_limit_state_restore(void)struct rapl_domain *rd;int nr_pl, i; -get_online_cpus (); +cpus_read_lock ();list_for_each_entry (rp, &rapl_packages, plist) {if (!rp->power_zone)continue ;
@@ -1425,7 +1425,7 @@ static void power_limit_state_restore(void) } } } -put_online_cpus (); +cpus_read_unlock (); } static int rapl_pm_callback(struct notifier_block *nb,
Signature · 1 line
2.32.0
Re: [PATCH 18/38] powercap: intel_rapl: Replace deprecated CPU-hotplug functions.
Quoted 214 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc "Rafael J. Wysocki" <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- drivers/powercap/intel_rapl_common.c | 50 ++++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-)drivers/powercap/intel_rapl_common.c +24
-24@@ -158,16 +158,16 @@ static int get_energy_counter(struct powercap_zone *power_zone,/* prevent CPU hotplug, make sure the RAPL domain does not go * away while reading the counter. */ -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone);if (!rapl_read_data_raw (rd,ENERGY_COUNTER , true, &energy_now)) { *energy_raw = energy_now; -put_online_cpus (); +cpus_read_unlock ();return 0 ; } -put_online_cpus (); +cpus_read_unlock ();return -EIO ; }@@ -216,11 +216,11 @@ static int set_domain_enable(struct powercap_zone *power_zone, bool mode)if (rd->state &DOMAIN_STATE_BIOS_LOCKED )return -EACCES ; -get_online_cpus (); +cpus_read_lock ();rapl_write_data_raw (rd,PL1_ENABLE , mode);if (rapl_defaults->set_floor_freq) rapl_defaults->set_floor_freq (rd, mode); -put_online_cpus (); +cpus_read_unlock ();return 0 ; }@@ -234,13 +234,13 @@ static int get_domain_enable(struct powercap_zone *power_zone, bool *mode) *mode = false;return 0 ; } -get_online_cpus (); +cpus_read_lock ();if (rapl_read_data_raw (rd,PL1_ENABLE , true, &val)) { -put_online_cpus (); +cpus_read_unlock ();return -EIO ; } *mode = val; -put_online_cpus (); +cpus_read_unlock ();return 0 ; }@@ -317,7 +317,7 @@ static int set_power_limit(struct powercap_zone *power_zone, int cid,int ret =0 ;int id; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone); id =contraint_to_pl (rd, cid);if (id <0 ) {@@ -350,7 +350,7 @@ static int set_power_limit(struct powercap_zone *power_zone, int cid,if (!ret)package_power_limit_irq_save (rp); set_exit: -put_online_cpus (); +cpus_read_unlock ();return ret; }@@ -363,7 +363,7 @@ static int get_current_power_limit(struct powercap_zone *power_zone, int cid,int ret =0 ;int id; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone); id =contraint_to_pl (rd, cid);if (id <0 ) {@@ -382,7 +382,7 @@ static int get_current_power_limit(struct powercap_zone *power_zone, int cid, prim =POWER_LIMIT4 ;break ;default : -put_online_cpus (); +cpus_read_unlock ();return -EINVAL ; }if (rapl_read_data_raw (rd, prim, true, &val))@@ -391,7 +391,7 @@ static int get_current_power_limit(struct powercap_zone *power_zone, int cid, *data = val; get_exit: -put_online_cpus (); +cpus_read_unlock ();return ret; }@@ -403,7 +403,7 @@ static int set_time_window(struct powercap_zone *power_zone, int cid,int ret =0 ;int id; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone); id =contraint_to_pl (rd, cid);if (id <0 ) {@@ -423,7 +423,7 @@ static int set_time_window(struct powercap_zone *power_zone, int cid, } set_time_exit: -put_online_cpus (); +cpus_read_unlock ();return ret; }@@ -435,7 +435,7 @@ static int get_time_window(struct powercap_zone *power_zone, int cid,int ret =0 ;int id; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone); id =contraint_to_pl (rd, cid);if (id <0 ) {@@ -458,14 +458,14 @@ static int get_time_window(struct powercap_zone *power_zone, int cid, val =0 ;break ;default : -put_online_cpus (); +cpus_read_unlock ();return -EINVAL ; }if (!ret) *data = val; get_time_exit: -put_online_cpus (); +cpus_read_unlock ();return ret; }@@ -491,7 +491,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id, u64 *data)int prim;int ret =0 ; -get_online_cpus (); +cpus_read_lock (); rd =power_zone_to_rapl_domain (power_zone);switch (rd->rpl[id].prim_id) {case PL1_ENABLE :@@ -504,7 +504,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id, u64 *data) prim =MAX_POWER ;break ;default : -put_online_cpus (); +cpus_read_unlock ();return -EINVAL ; }if (rapl_read_data_raw (rd, prim, true, &val))@@ -516,7 +516,7 @@ static int get_max_power(struct powercap_zone *power_zone, int id, u64 *data)if (rd->rpl[id].prim_id ==PL4_ENABLE ) *data = *data *2 ; -put_online_cpus (); +cpus_read_unlock ();return ret; }@@ -1358,7 +1358,7 @@ static void power_limit_state_save(void)struct rapl_domain *rd;int nr_pl, ret, i; -get_online_cpus (); +cpus_read_lock ();list_for_each_entry (rp, &rapl_packages, plist) {if (!rp->power_zone)continue ;@@ -1390,7 +1390,7 @@ static void power_limit_state_save(void) } } } -put_online_cpus (); +cpus_read_unlock (); }static void power_limit_state_restore (void )@@ -1399,7 +1399,7 @@ static void power_limit_state_restore(void)struct rapl_domain *rd;int nr_pl, i; -get_online_cpus (); +cpus_read_lock ();list_for_each_entry (rp, &rapl_packages, plist) {if (!rp->power_zone)continue ;
drivers/powercap/intel_rapl_common.c static void power_limit_state_restore(void)
Quoted 9 lines
drivers/powercap/intel_rapl_common.c +1
-2@@ -1425,7 +1425,7 @@ static void power_limit_state_restore(void) } } } -put_online_cpus (); +cpus_read_unlock (); } static int rapl_pm_callback(struct notifier_block *nb, --
Applied as 5.15 material, thanks!
PATCH 19/38 thermal: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/thermal/intel/intel_powerclamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/intel/intel_powerclamp.c +2 -2
@@ -528,7 +528,7 @@ static int start_power_clamp(void) set_target_ratio =clamp (set_target_ratio,0U ,MAX_TARGET_RATIO -1 );/* prevent cpu hotplug */ -get_online_cpus (); +cpus_read_lock ();/* prefer BSP */ control_cpu =0 ;
@@ -542,7 +542,7 @@ static int start_power_clamp(void)for_each_online_cpu (cpu) {start_power_clamp_worker (cpu); } -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
Signature · 1 line
2.32.0
Daniel Lezcano
AppliedRe: [PATCH 19/38] thermal: Replace deprecated CPU-hotplug functions.
Quoted 7 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Quoted 8 lines
Cc Zhang Rui <[email protected]>Cc Daniel Lezcano <[email protected]>Cc Amit Kucheria <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- drivers/thermal/intel/intel_powerclamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied.
Thanks
-- D.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
[thermal: thermal/next] thermal/drivers/intel_powerclamp: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe following commit has been merged into the thermal/next branch of thermal:
The following commit has been merged into the thermal/next branch of thermal:
Commit-ID: d31eb7c1a2288f61df75558f59328be01a264300 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//d31eb7c1a2288f61df75558f59328be01a264300 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:02 +02:00 Committer: Daniel Lezcano <[email protected]> CommitterDate: Sat, 14 Aug 2021 12:51:42 +02:00
thermal/drivers/intel_powerclamp: 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.
--- drivers/thermal/intel/intel_powerclamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/intel/intel_powerclamp.c +2 -2
@@ -528,7 +528,7 @@ static int start_power_clamp(void) set_target_ratio =clamp (set_target_ratio,0U ,MAX_TARGET_RATIO -1 );/* prevent cpu hotplug */ -get_online_cpus (); +cpus_read_lock ();/* prefer BSP */ control_cpu =0 ;
@@ -542,7 +542,7 @@ static int start_power_clamp(void)for_each_online_cpu (cpu) {start_power_clamp_worker (cpu); } -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
[tip: smp/urgent] thermal: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe following commit has been merged into the smp/urgent branch of tip:
The following commit has been merged into the smp/urgent branch of tip:
Commit-ID: c122358ea1e510d3def876abb7872f1b2b7365c9 Gitweb: https://git.kernel.org/tip/c122358ea1e510d3def876abb7872f1b2b7365c9 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:02 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sat, 11 Sep 2021 00:41:21 +02:00
thermal: 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.
--- drivers/thermal/intel/intel_powerclamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/intel/intel_powerclamp.c +2 -2
@@ -528,7 +528,7 @@ static int start_power_clamp(void) set_target_ratio =clamp (set_target_ratio,0U ,MAX_TARGET_RATIO -1 );/* prevent cpu hotplug */ -get_online_cpus (); +cpus_read_lock ();/* prefer BSP */ control_cpu =0 ;
@@ -542,7 +542,7 @@ static int start_power_clamp(void)for_each_online_cpu (cpu) {start_power_clamp_worker (cpu); } -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
Re: [tip: smp/urgent] thermal: Replace deprecated CPU-hotplug functions.
Hi,
I have already this patch.
-- Daniel
Quoted 49 lines · On 11/09/2021 00:45, tip-bot2 for Sebastian Andrzej Siewior wrote:
The following commit has been merged into the smp/urgent branch of tip:
Commit-ID: c122358ea1e510d3def876abb7872f1b2b7365c9 Gitweb: https://git.kernel.org/tip/c122358ea1e510d3def876abb7872f1b2b7365c9 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:02 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sat, 11 Sep 2021 00:41:21 +02:00thermal: Replace deprecated CPU-hotplug functions.
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_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]>--- drivers/thermal/intel/intel_powerclamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/thermal/intel/intel_powerclamp.c +2
-2@@ -528,7 +528,7 @@ static int start_power_clamp(void) set_target_ratio =clamp (set_target_ratio,0U ,MAX_TARGET_RATIO -1 );/* prevent cpu hotplug */ -get_online_cpus (); +cpus_read_lock ();/* prefer BSP */ control_cpu =0 ;@@ -542,7 +542,7 @@ static int start_power_clamp(void)for_each_online_cpu (cpu) {start_power_clamp_worker (cpu); } -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Borislav Petkov
maintainerRe: [tip: smp/urgent] thermal: Replace deprecated CPU-hotplug functions.
Quoted 1 line · Daniel Lezcano
I have already this patch.
Ok, I'll hold off on sending smp/urgent Linuswards tomorrow then, especially since he's merged your pull request already.
We can recreate that tree after -rc1 is out and do the final zap of the deprecated CPU hotplug wrappers then.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquettePATCH 20/38 mm: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- mm/swap_slots.c | 4 ++-- mm/vmstat.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-)
mm/swap_slots.c +2 -2
@@ -70,9 +70,9 @@ void disable_swap_slots_cache_lock(void) swap_slot_cache_enabled = false;if (swap_slot_cache_initialized) {/* serialize with cpu hotplug operations */ -get_online_cpus (); +cpus_read_lock ();__drain_swap_slots_cache (SLOTS_CACHE |SLOTS_CACHE_RET ); -put_online_cpus (); +cpus_read_unlock (); } }
mm/vmstat.c +6 -6
@@ -129,9 +129,9 @@ static void sum_vm_events(unsigned long *ret)*/ void all_vm_events (unsigned long *ret) { -get_online_cpus (); +cpus_read_lock ();sum_vm_events (ret); -put_online_cpus (); +cpus_read_unlock (); }EXPORT_SYMBOL_GPL (all_vm_events);
@@ -1948,7 +1948,7 @@ static void vmstat_shepherd(struct work_struct *w) {int cpu; -get_online_cpus (); +cpus_read_lock ();/* Check processors whose vmstat worker threads have been disabled */ for_each_online_cpu (cpu) {struct delayed_work *dw = &per_cpu (vmstat_work, cpu);
@@ -1958,7 +1958,7 @@ static void vmstat_shepherd(struct work_struct *w)cond_resched (); } -put_online_cpus (); +cpus_read_unlock ();schedule_delayed_work (&shepherd,round_jiffies_relative (sysctl_stat_interval));
@@ -2037,9 +2037,9 @@ void __init init_mm_internals(void)if (ret <0 )pr_err ("vmstat: failed to register 'online' hotplug state\n" ); -get_online_cpus (); +cpus_read_lock ();init_cpu_node_state (); -put_online_cpus (); +cpus_read_unlock ();start_shepherd_timer ();#endif
Signature · 1 line
2.32.0
[tip: smp/core] mm: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the smp/core branch of tip:
The following commit has been merged into the smp/core branch of tip:
Commit-ID: 7625eccd1852ac84d3aa6a06ffc2f710e683b3fe Gitweb: https://git.kernel.org/tip/7625eccd1852ac84d3aa6a06ffc2f710e683b3fe Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:03 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sat, 28 Aug 2021 01:46:17 +02:00
mm: 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.
--- mm/swap_slots.c | 4 ++-- mm/vmstat.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-)
mm/swap_slots.c +2 -2
@@ -70,9 +70,9 @@ void disable_swap_slots_cache_lock(void) swap_slot_cache_enabled = false;if (swap_slot_cache_initialized) {/* serialize with cpu hotplug operations */ -get_online_cpus (); +cpus_read_lock ();__drain_swap_slots_cache (SLOTS_CACHE |SLOTS_CACHE_RET ); -put_online_cpus (); +cpus_read_unlock (); } }
mm/vmstat.c +6 -6
@@ -129,9 +129,9 @@ static void sum_vm_events(unsigned long *ret)*/ void all_vm_events (unsigned long *ret) { -get_online_cpus (); +cpus_read_lock ();sum_vm_events (ret); -put_online_cpus (); +cpus_read_unlock (); }EXPORT_SYMBOL_GPL (all_vm_events);
@@ -1948,7 +1948,7 @@ static void vmstat_shepherd(struct work_struct *w) {int cpu; -get_online_cpus (); +cpus_read_lock ();/* Check processors whose vmstat worker threads have been disabled */ for_each_online_cpu (cpu) {struct delayed_work *dw = &per_cpu (vmstat_work, cpu);
@@ -1958,7 +1958,7 @@ static void vmstat_shepherd(struct work_struct *w)cond_resched (); } -put_online_cpus (); +cpus_read_unlock ();schedule_delayed_work (&shepherd,round_jiffies_relative (sysctl_stat_interval));
@@ -2037,9 +2037,9 @@ void __init init_mm_internals(void)if (ret <0 )pr_err ("vmstat: failed to register 'online' hotplug state\n" ); -get_online_cpus (); +cpus_read_lock ();init_cpu_node_state (); -put_online_cpus (); +cpus_read_unlock ();start_shepherd_timer ();#endif
PATCH 21/38 virtio_net: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/net/virtio_net.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/virtio_net.c +5 -5
@@ -2208,14 +2208,14 @@ static int virtnet_set_channels(struct net_device *dev,if (vi->rq[0 ].xdp_prog)return -EINVAL ; -get_online_cpus (); +cpus_read_lock (); err =_virtnet_set_queues (vi, queue_pairs);if (err) { -put_online_cpus (); +cpus_read_unlock (); goto err; }virtnet_set_affinity (vi); -put_online_cpus (); +cpus_read_unlock ();netif_set_real_num_tx_queues (dev, queue_pairs);netif_set_real_num_rx_queues (dev, queue_pairs);
@@ -2970,9 +2970,9 @@ static int init_vqs(struct virtnet_info *vi)if (ret) goto err_free; -get_online_cpus (); +cpus_read_lock ();virtnet_set_affinity (vi); -put_online_cpus (); +cpus_read_unlock ();return 0 ;
Signature · 6 lines
2.32.0 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH 21/38] virtio_net: Replace deprecated CPU-hotplug functions.
Quoted 7 lines · On Tue, 3 Aug 2021 16:16:04 +0200 Sebastian Andrzej Siewior wrote:
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Quoted 7 lines
Cc "Michael S. Tsirkin" <[email protected]>Cc Jason Wang <[email protected]>Cc "David S. Miller" <[email protected]>Cc Jakub Kicinski <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Applied this one and 21 to net-next, thanks!
PATCH 22/38 net/af_iucv: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- net/iucv/iucv.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
net/iucv/iucv.c +9 -9
@@ -500,14 +500,14 @@ static void iucv_setmask_mp(void) {int cpu; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu)/* Enable all cpus with a declared buffer. */ if (cpumask_test_cpu (cpu, &iucv_buffer_cpumask) && !cpumask_test_cpu (cpu, &iucv_irq_cpumask))smp_call_function_single (cpu, iucv_allow_cpu,NULL ,1 ); -put_online_cpus (); +cpus_read_unlock (); }/**
@@ -540,7 +540,7 @@ static int iucv_enable(void)size_t alloc_size;int cpu, rc; -get_online_cpus (); +cpus_read_lock (); rc = -ENOMEM ; alloc_size = iucv_max_pathid *sizeof (struct iucv_path ); iucv_path_table =kzalloc (alloc_size,GFP_KERNEL );
@@ -553,12 +553,12 @@ static int iucv_enable(void)if (cpumask_empty (&iucv_buffer_cpumask))/* No cpu could declare an iucv buffer. */ goto out; -put_online_cpus (); +cpus_read_unlock ();return 0 ; out:kfree (iucv_path_table); iucv_path_table =NULL ; -put_online_cpus (); +cpus_read_unlock ();return rc; }
@@ -571,11 +571,11 @@ static int iucv_enable(void)*/ static void iucv_disable (void ) { -get_online_cpus (); +cpus_read_lock ();on_each_cpu (iucv_retrieve_cpu,NULL ,1 );kfree (iucv_path_table); iucv_path_table =NULL ; -put_online_cpus (); +cpus_read_unlock (); }static int iucv_cpu_dead (unsigned int cpu)
@@ -784,7 +784,7 @@ static int iucv_reboot_event(struct notifier_block *this,if (cpumask_empty (&iucv_irq_cpumask))return NOTIFY_DONE ; -get_online_cpus (); +cpus_read_lock ();on_each_cpu_mask (&iucv_irq_cpumask, iucv_block_cpu,NULL ,1 );preempt_disable ();for (i =0 ; i < iucv_max_pathid; i++) {
@@ -792,7 +792,7 @@ static int iucv_reboot_event(struct notifier_block *this,iucv_sever_pathid (i,NULL ); }preempt_enable (); -put_online_cpus (); +cpus_read_unlock ();iucv_disable ();return NOTIFY_DONE ; }
Signature · 1 line
2.32.0
Julian Wiedmann
AppliedRe: [PATCH 22/38] net/af_iucv: Replace deprecated CPU-hotplug functions.
Quoted 14 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Julian Wiedmann <[email protected]>Cc Karsten Graul <[email protected]>Cc "David S. Miller" <[email protected]>Cc Jakub Kicinski <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Quoted 4 lines
--- net/iucv/iucv.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
Applied, thanks.
I fixed up the subject to say "net/iucv: ...", as the change is in the iucv base-layer and not the socket code.
PATCH 23/38 net: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- net/core/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/dev.c +2 -2
@@ -5876,7 +5876,7 @@ static void flush_all_backlogs(void)*/ ASSERT_RTNL (); -get_online_cpus (); +cpus_read_lock ();cpumask_clear (&flush_cpus);for_each_online_cpu (cpu) {
@@ -5894,7 +5894,7 @@ static void flush_all_backlogs(void)for_each_cpu (cpu, &flush_cpus)flush_work (per_cpu_ptr (&flush_works, cpu)); -put_online_cpus (); +cpus_read_unlock (); }/* Pass the currently batched GRO_NORMAL SKBs up to the stack. */
Signature · 1 line
2.32.0
PATCH 24/38 cgroup: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/cgroup/cpuset.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
kernel/cgroup/cpuset.c +15 -15
@@ -979,7 +979,7 @@ partition_and_rebuild_sched_domains(int ndoms_new, cpumask_var_t doms_new[],* 'cpus' is removed, then call this routine to rebuild the * scheduler's dynamic sched domains. * -* Call with cpuset_mutex held. Takes get_online_cpus(). +* Call with cpuset_mutex held. Takes cpus_read_lock(). */ static void rebuild_sched_domains_locked (void ) {
@@ -1040,11 +1040,11 @@ static void rebuild_sched_domains_locked(void)void rebuild_sched_domains (void ) { -get_online_cpus (); +cpus_read_lock ();percpu_down_write (&cpuset_rwsem);rebuild_sched_domains_locked ();percpu_up_write (&cpuset_rwsem); -put_online_cpus (); +cpus_read_unlock (); }/**
@@ -2282,7 +2282,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft,cpuset_filetype_t type = cft->private;int retval =0 ; -get_online_cpus (); +cpus_read_lock ();percpu_down_write (&cpuset_rwsem);if (!is_cpuset_online (cs)) { retval = -ENODEV ;
@@ -2320,7 +2320,7 @@ static int cpuset_write_u64(struct cgroup_subsys_state *css, struct cftype *cft, } out_unlock:percpu_up_write (&cpuset_rwsem); -put_online_cpus (); +cpus_read_unlock ();return retval; }
@@ -2331,7 +2331,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft,cpuset_filetype_t type = cft->private;int retval = -ENODEV ; -get_online_cpus (); +cpus_read_lock ();percpu_down_write (&cpuset_rwsem);if (!is_cpuset_online (cs)) goto out_unlock;
@@ -2346,7 +2346,7 @@ static int cpuset_write_s64(struct cgroup_subsys_state *css, struct cftype *cft, } out_unlock:percpu_up_write (&cpuset_rwsem); -put_online_cpus (); +cpus_read_unlock ();return retval; }
@@ -2385,7 +2385,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of,kernfs_break_active_protection (of->kn);flush_work (&cpuset_hotplug_work); -get_online_cpus (); +cpus_read_lock ();percpu_down_write (&cpuset_rwsem);if (!is_cpuset_online (cs)) goto out_unlock;
@@ -2411,7 +2411,7 @@ static ssize_t cpuset_write_resmask(struct kernfs_open_file *of,free_cpuset (trialcs); out_unlock:percpu_up_write (&cpuset_rwsem); -put_online_cpus (); +cpus_read_unlock ();kernfs_unbreak_active_protection (of->kn);css_put (&cs->css);flush_workqueue (cpuset_migrate_mm_wq);
@@ -2542,7 +2542,7 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf,return -EINVAL ;css_get (&cs->css); -get_online_cpus (); +cpus_read_lock ();percpu_down_write (&cpuset_rwsem);if (!is_cpuset_online (cs)) goto out_unlock;
@@ -2550,7 +2550,7 @@ static ssize_t sched_partition_write(struct kernfs_open_file *of, char *buf, retval =update_prstate (cs, val); out_unlock:percpu_up_write (&cpuset_rwsem); -put_online_cpus (); +cpus_read_unlock ();css_put (&cs->css);return retval ?: nbytes; }
@@ -2756,7 +2756,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)if (!parent)return 0 ; -get_online_cpus (); +cpus_read_lock ();percpu_down_write (&cpuset_rwsem);set_bit (CS_ONLINE , &cs->flags);
@@ -2809,7 +2809,7 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)spin_unlock_irq (&callback_lock); out_unlock:percpu_up_write (&cpuset_rwsem); -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
@@ -2828,7 +2828,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css) {struct cpuset *cs =css_cs (css); -get_online_cpus (); +cpus_read_lock ();percpu_down_write (&cpuset_rwsem);if (is_partition_root (cs))
@@ -2849,7 +2849,7 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css)clear_bit (CS_ONLINE , &cs->flags);percpu_up_write (&cpuset_rwsem); -put_online_cpus (); +cpus_read_unlock (); }static void cpuset_css_free (struct cgroup_subsys_state *css)
Signature · 1 line
2.32.0
Re: [PATCH 24/38] cgroup: Replace deprecated CPU-hotplug functions.
Quoted 4 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().
Quoted 8 lines
Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Zefan Li <[email protected]>Cc Tejun Heo <[email protected]>Cc Johannes Weiner <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Applied to cgroup/for-5.15.
Thanks.
Signature · 1 line
tejun
PATCH 25/38 genirq/affinity: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/irq/affinity.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/irq/affinity.c +4 -4
@@ -355,7 +355,7 @@ static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, goto fail_npresmsk;/* Stabilize the cpumasks */ -get_online_cpus (); +cpus_read_lock ();build_node_to_cpumask (node_to_cpumask);/* Spread on present CPUs starting from affd->pre_vectors */
@@ -384,7 +384,7 @@ static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, nr_others = ret; fail_build_affinity: -put_online_cpus (); +cpus_read_unlock ();if (ret >=0 )WARN_ON (nr_present + nr_others < numvecs);
@@ -505,9 +505,9 @@ unsigned int irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,if (affd->calc_sets) { set_vecs = maxvec - resv; }else { -get_online_cpus (); +cpus_read_lock (); set_vecs =cpumask_weight (cpu_possible_mask); -put_online_cpus (); +cpus_read_unlock (); }return resv +min (set_vecs, maxvec - resv);
Signature · 1 line
2.32.0
[tip: irq/core] genirq/affinity: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the irq/core branch of tip:
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 428e211641ed808b55cdc7d880a0ee349eff354b Gitweb: https://git.kernel.org/tip/428e211641ed808b55cdc7d880a0ee349eff354b Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:08 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 14:51:26 +02:00
genirq/affinity: 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.
--- kernel/irq/affinity.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/irq/affinity.c +4 -4
@@ -355,7 +355,7 @@ static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, goto fail_npresmsk;/* Stabilize the cpumasks */ -get_online_cpus (); +cpus_read_lock ();build_node_to_cpumask (node_to_cpumask);/* Spread on present CPUs starting from affd->pre_vectors */
@@ -384,7 +384,7 @@ static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, nr_others = ret; fail_build_affinity: -put_online_cpus (); +cpus_read_unlock ();if (ret >=0 )WARN_ON (nr_present + nr_others < numvecs);
@@ -505,9 +505,9 @@ unsigned int irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,if (affd->calc_sets) { set_vecs = maxvec - resv; }else { -get_online_cpus (); +cpus_read_lock (); set_vecs =cpumask_weight (cpu_possible_mask); -put_online_cpus (); +cpus_read_unlock (); }return resv +min (set_vecs, maxvec - resv);
PATCH 26/38 livepatch: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/livepatch/transition.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/livepatch/transition.c +2 -2
@@ -411,7 +411,7 @@ void klp_try_complete_transition(void)/* * Ditto for the idle "swapper" tasks. */ -get_online_cpus (); +cpus_read_lock ();for_each_possible_cpu (cpu) { task =idle_task (cpu);if (cpu_online (cpu)) {
@@ -423,7 +423,7 @@ void klp_try_complete_transition(void) task->patch_state = klp_target_state; } } -put_online_cpus (); +cpus_read_unlock ();if (!complete) {if (klp_signals_cnt && !(klp_signals_cnt %SIGNALS_TIMEOUT ))
Signature · 1 line
2.32.0
Re: [PATCH 26/38] livepatch: Replace deprecated CPU-hotplug functions.
Quoted 7 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Quoted 7 lines
Cc Josh Poimboeuf <[email protected]>Cc Jiri Kosina <[email protected]>Cc Miroslav Benes <[email protected]>Cc Petr Mladek <[email protected]>Cc Joe Lawrence <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Best Regards,
Petr
Re: [PATCH 26/38] livepatch: Replace deprecated CPU-hotplug functions.
Quoted 15 lines · Petr Mladek
Quoted 7 lines
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Quoted 7 lines
Cc Josh Poimboeuf <[email protected]>Cc Jiri Kosina <[email protected]>Cc Miroslav Benes <[email protected]>Cc Petr Mladek <[email protected]>Cc Joe Lawrence <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Quoted 1 line
Reviewed-by Petr Mladek <[email protected]>
As this doesn't seem to have been picked up yet, I've just applied it to livepatching.git#for-5.15/cpu-hotplug
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
PATCH 27/38 padata: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/padata.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
kernel/padata.c +7 -7
@@ -733,7 +733,7 @@ int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,struct cpumask *serial_mask, *parallel_mask;int err = -EINVAL ; -get_online_cpus (); +cpus_read_lock ();mutex_lock (&pinst->lock);switch (cpumask_type) {
@@ -753,7 +753,7 @@ int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type, out:mutex_unlock (&pinst->lock); -put_online_cpus (); +cpus_read_unlock ();return err; }
@@ -992,7 +992,7 @@ struct padata_instance *padata_alloc(const char *name)if (!pinst->parallel_wq) goto err_free_inst; -get_online_cpus (); +cpus_read_lock (); pinst->serial_wq =alloc_workqueue ("%s_serial" ,WQ_MEM_RECLAIM |WQ_CPU_INTENSIVE ,1 , name);
@@ -1026,7 +1026,7 @@ struct padata_instance *padata_alloc(const char *name) &pinst->cpu_dead_node);#endif -put_online_cpus (); +cpus_read_unlock ();return pinst;
@@ -1036,7 +1036,7 @@ struct padata_instance *padata_alloc(const char *name) err_free_serial_wq:destroy_workqueue (pinst->serial_wq); err_put_cpus: -put_online_cpus (); +cpus_read_unlock ();destroy_workqueue (pinst->parallel_wq); err_free_inst:kfree (pinst);
@@ -1074,9 +1074,9 @@ struct padata_shell *padata_alloc_shell(struct padata_instance *pinst) ps->pinst = pinst; -get_online_cpus (); +cpus_read_lock (); pd =padata_alloc_pd (ps); -put_online_cpus (); +cpus_read_unlock ();if (!pd) goto out_free_ps;
Signature · 1 line
2.32.0
Re: [PATCH 27/38] padata: Replace deprecated CPU-hotplug functions.
Quoted 11 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Steffen Klassert <[email protected]>Cc Daniel Jordan <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Satisfying to see the old wrappers finally go away.
Herbert Xu
maintainerRe: [PATCH 27/38] padata: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorQuoted 7 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Quoted 7 lines
Cc Steffen Klassert <[email protected]>Cc Daniel Jordan <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- kernel/padata.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
PATCH 28/38 cpufreq: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- drivers/cpufreq/acpi-cpufreq.c | 4 ++-- drivers/cpufreq/cpufreq.c | 6 +++--- drivers/cpufreq/cpufreq_ondemand.c | 4 ++-- drivers/cpufreq/intel_pstate.c | 4 ++-- drivers/cpufreq/powernow-k8.c | 6 +++--- drivers/cpufreq/powernv-cpufreq.c | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-)
drivers/cpufreq/acpi-cpufreq.c +2 -2
@@ -163,9 +163,9 @@ static ssize_t store_cpb(struct cpufreq_policy *policy, const char *buf,if (ret || val >1 )return -EINVAL ; -get_online_cpus (); +cpus_read_lock ();set_boost (policy, val); -put_online_cpus (); +cpus_read_unlock ();return count; }
drivers/cpufreq/cpufreq.c +3 -3
@@ -2654,18 +2654,18 @@ int cpufreq_boost_trigger_state(int state) cpufreq_driver->boost_enabled = state;write_unlock_irqrestore (&cpufreq_driver_lock, flags); -get_online_cpus (); +cpus_read_lock ();for_each_active_policy (policy) { ret = cpufreq_driver->set_boost (policy, state);if (ret) goto err_reset_state; } -put_online_cpus (); +cpus_read_unlock ();return 0 ; err_reset_state: -put_online_cpus (); +cpus_read_unlock ();write_lock_irqsave (&cpufreq_driver_lock, flags); cpufreq_driver->boost_enabled = !state;
drivers/cpufreq/cpufreq_ondemand.c +2 -2
@@ -418,7 +418,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias) default_powersave_bias = powersave_bias;cpumask_clear (&done); -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {struct cpufreq_policy *policy;struct policy_dbs_info *policy_dbs;
@@ -442,7 +442,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias) od_tuners = dbs_data->tuners; od_tuners->powersave_bias = default_powersave_bias; } -put_online_cpus (); +cpus_read_unlock (); } void od_register_powersave_bias_handler(unsigned int (*f)
drivers/cpufreq/intel_pstate.c +2 -2
@@ -2969,7 +2969,7 @@ static void intel_pstate_driver_cleanup(void) {unsigned int cpu; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {if (all_cpu_data[cpu]) {if (intel_pstate_driver == &intel_pstate)
@@ -2979,7 +2979,7 @@ static void intel_pstate_driver_cleanup(void) all_cpu_data[cpu] =NULL ; } } -put_online_cpus (); +cpus_read_unlock (); intel_pstate_driver =NULL ; }
drivers/cpufreq/powernow-k8.c +3 -3
@@ -1180,7 +1180,7 @@ static int powernowk8_init(void)if (!x86_match_cpu (powernow_k8_ids))return -ENODEV ; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (i) {smp_call_function_single (i, check_supported_cpu, &ret,1 );if (!ret)
@@ -1188,10 +1188,10 @@ static int powernowk8_init(void) }if (supported_cpus !=num_online_cpus ()) { -put_online_cpus (); +cpus_read_unlock ();return -ENODEV ; } -put_online_cpus (); +cpus_read_unlock (); ret =cpufreq_register_driver (&cpufreq_amd64_driver);if (ret)
drivers/cpufreq/powernv-cpufreq.c +2 -2
@@ -918,7 +918,7 @@ static void powernv_cpufreq_work_fn(struct work_struct *work)unsigned int cpu;cpumask_t mask; -get_online_cpus (); +cpus_read_lock ();cpumask_and (&mask, &chip->mask, cpu_online_mask);smp_call_function_any (&mask, powernv_cpufreq_throttle_check,NULL ,0 );
@@ -939,7 +939,7 @@ static void powernv_cpufreq_work_fn(struct work_struct *work)cpufreq_cpu_put (policy); } out: -put_online_cpus (); +cpus_read_unlock (); } static int powernv_cpufreq_occ_msg(struct notifier_block *nb,
Signature · 1 line
2.32.0
Re: [PATCH 28/38] cpufreq: Replace deprecated CPU-hotplug functions.
Quoted 152 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc "Rafael J. Wysocki" <[email protected]>Cc Viresh Kumar <[email protected]>Cc Srinivas Pandruvada <[email protected]>Cc Len Brown <[email protected]>Cc Michael Ellerman <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc Paul Mackerras <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- drivers/cpufreq/acpi-cpufreq.c | 4 ++-- drivers/cpufreq/cpufreq.c | 6 +++--- drivers/cpufreq/cpufreq_ondemand.c | 4 ++-- drivers/cpufreq/intel_pstate.c | 4 ++-- drivers/cpufreq/powernow-k8.c | 6 +++--- drivers/cpufreq/powernv-cpufreq.c | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-)drivers/cpufreq/acpi-cpufreq.c +2
-2@@ -163,9 +163,9 @@ static ssize_t store_cpb(struct cpufreq_policy *policy, const char *buf,if (ret || val >1 )return -EINVAL ; -get_online_cpus (); +cpus_read_lock ();set_boost (policy, val); -put_online_cpus (); +cpus_read_unlock ();return count; }drivers/cpufreq/cpufreq.c +3
-3@@ -2654,18 +2654,18 @@ int cpufreq_boost_trigger_state(int state) cpufreq_driver->boost_enabled = state;write_unlock_irqrestore (&cpufreq_driver_lock, flags); -get_online_cpus (); +cpus_read_lock ();for_each_active_policy (policy) { ret = cpufreq_driver->set_boost (policy, state);if (ret) goto err_reset_state; } -put_online_cpus (); +cpus_read_unlock ();return 0 ; err_reset_state: -put_online_cpus (); +cpus_read_unlock ();write_lock_irqsave (&cpufreq_driver_lock, flags); cpufreq_driver->boost_enabled = !state;drivers/cpufreq/cpufreq_ondemand.c +2
-2@@ -418,7 +418,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias) default_powersave_bias = powersave_bias;cpumask_clear (&done); -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {struct cpufreq_policy *policy;struct policy_dbs_info *policy_dbs;@@ -442,7 +442,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias) od_tuners = dbs_data->tuners; od_tuners->powersave_bias = default_powersave_bias; } -put_online_cpus (); +cpus_read_unlock (); } void od_register_powersave_bias_handler(unsigned int (*f)drivers/cpufreq/intel_pstate.c +2
-2@@ -2969,7 +2969,7 @@ static void intel_pstate_driver_cleanup(void) {unsigned int cpu; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {if (all_cpu_data[cpu]) {if (intel_pstate_driver == &intel_pstate)@@ -2979,7 +2979,7 @@ static void intel_pstate_driver_cleanup(void) all_cpu_data[cpu] =NULL ; } } -put_online_cpus (); +cpus_read_unlock (); intel_pstate_driver =NULL ; }drivers/cpufreq/powernow-k8.c +3
-3@@ -1180,7 +1180,7 @@ static int powernowk8_init(void)if (!x86_match_cpu (powernow_k8_ids))return -ENODEV ; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (i) {smp_call_function_single (i, check_supported_cpu, &ret,1 );if (!ret)@@ -1188,10 +1188,10 @@ static int powernowk8_init(void) }if (supported_cpus !=num_online_cpus ()) { -put_online_cpus (); +cpus_read_unlock ();return -ENODEV ; } -put_online_cpus (); +cpus_read_unlock (); ret =cpufreq_register_driver (&cpufreq_amd64_driver);if (ret)drivers/cpufreq/powernv-cpufreq.c +1
-1@@ -918,7 +918,7 @@ static void powernv_cpufreq_work_fn(struct work_struct *work)unsigned int cpu;cpumask_t mask; -get_online_cpus (); +cpus_read_lock ();cpumask_and (&mask, &chip->mask, cpu_online_mask);smp_call_function_any (&mask, powernv_cpufreq_throttle_check,NULL ,0 );
drivers/cpufreq/powernv-cpufreq.c static void powernv_cpufreq_work_fn(struct work_struct *work)
Quoted 9 lines
drivers/cpufreq/powernv-cpufreq.c +1
-2@@ -939,7 +939,7 @@ static void powernv_cpufreq_work_fn(struct work_struct *work)cpufreq_cpu_put (policy); } out: -put_online_cpus (); +cpus_read_unlock (); } static int powernv_cpufreq_occ_msg(struct notifier_block *nb, --
Applied as 5.15 material, thanks!
PATCH 29/38 ACPI: processor: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe functions cpu_hotplug_begin, cpu_hotplug_done, get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_write_lock(), cpus_write_unlock, cpus_read_lock() and cpus_read_unlock().
Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
--- drivers/acpi/acpi_pad.c | 4 ++-- drivers/acpi/acpi_processor.c | 8 ++++---- drivers/acpi/processor_idle.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/acpi/acpi_pad.c +2 -2
@@ -249,12 +249,12 @@ static void set_power_saving_task_num(unsigned int num)static void acpi_pad_idle_cpus (unsigned int num_cpus) { -get_online_cpus (); +cpus_read_lock (); num_cpus = min_t(unsigned int, num_cpus, num_online_cpus());set_power_saving_task_num (num_cpus); -put_online_cpus (); +cpus_read_unlock (); }static uint32_t acpi_pad_idle_cpus_num (void )
drivers/acpi/acpi_processor.c +4 -4
@@ -182,7 +182,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)return -ENODEV ;cpu_maps_update_begin (); -cpu_hotplug_begin (); +cpus_write_lock (); ret =acpi_map_cpu (pr->handle, pr->phys_id, pr->acpi_id, &pr->id);if (ret)
@@ -203,7 +203,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) pr->flags.need_hotplug_init =1 ; out: -cpu_hotplug_done (); +cpus_write_unlock ();cpu_maps_update_done ();return ret; }
@@ -454,13 +454,13 @@ static void acpi_processor_remove(struct acpi_device *device)per_cpu (processors, pr->id) =NULL ;cpu_maps_update_begin (); -cpu_hotplug_begin (); +cpus_write_lock ();/* Remove the CPU. */ arch_unregister_cpu (pr->id);acpi_unmap_cpu (pr->id); -cpu_hotplug_done (); +cpus_write_unlock ();cpu_maps_update_done ();try_offline_node (cpu_to_node (pr->id));
drivers/acpi/processor_idle.c +2 -2
@@ -1301,7 +1301,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr)if (pr->id ==0 &&cpuidle_get_driver () == &acpi_idle_driver) {/* Protect against cpu-hotplug */ -get_online_cpus (); +cpus_read_lock ();cpuidle_pause_and_lock ();/* Disable all cpuidle devices */
@@ -1330,7 +1330,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr) } }cpuidle_resume_and_unlock (); -put_online_cpus (); +cpus_read_unlock (); }return 0 ;
Signature · 1 line
2.32.0
Re: [PATCH 29/38] ACPI: processor: Replace deprecated CPU-hotplug functions.
Quoted 90 lines · Sebastian Andrzej Siewior
The functions
cpu_hotplug_begin,cpu_hotplug_done,get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_write_lock(),cpus_write_unlock,cpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc "Rafael J. Wysocki" <[email protected]>Cc Len Brown <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- drivers/acpi/acpi_pad.c | 4 ++-- drivers/acpi/acpi_processor.c | 8 ++++---- drivers/acpi/processor_idle.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-)drivers/acpi/acpi_pad.c +2
-2@@ -249,12 +249,12 @@ static void set_power_saving_task_num(unsigned int num)static void acpi_pad_idle_cpus (unsigned int num_cpus) { -get_online_cpus (); +cpus_read_lock (); num_cpus = min_t(unsigned int, num_cpus, num_online_cpus());set_power_saving_task_num (num_cpus); -put_online_cpus (); +cpus_read_unlock (); }static uint32_t acpi_pad_idle_cpus_num (void )drivers/acpi/acpi_processor.c +4
-4@@ -182,7 +182,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)return -ENODEV ;cpu_maps_update_begin (); -cpu_hotplug_begin (); +cpus_write_lock (); ret =acpi_map_cpu (pr->handle, pr->phys_id, pr->acpi_id, &pr->id);if (ret)@@ -203,7 +203,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) pr->flags.need_hotplug_init =1 ; out: -cpu_hotplug_done (); +cpus_write_unlock ();cpu_maps_update_done ();return ret; }@@ -454,13 +454,13 @@ static void acpi_processor_remove(struct acpi_device *device)per_cpu (processors, pr->id) =NULL ;cpu_maps_update_begin (); -cpu_hotplug_begin (); +cpus_write_lock ();/* Remove the CPU. */ arch_unregister_cpu (pr->id);acpi_unmap_cpu (pr->id); -cpu_hotplug_done (); +cpus_write_unlock ();cpu_maps_update_done ();try_offline_node (cpu_to_node (pr->id));drivers/acpi/processor_idle.c +1
-1@@ -1301,7 +1301,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr)if (pr->id ==0 &&cpuidle_get_driver () == &acpi_idle_driver) {/* Protect against cpu-hotplug */ -get_online_cpus (); +cpus_read_lock ();cpuidle_pause_and_lock ();/* Disable all cpuidle devices */
drivers/acpi/processor_idle.c int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
Quoted 9 lines
drivers/acpi/processor_idle.c +1
-2@@ -1330,7 +1330,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr) } }cpuidle_resume_and_unlock (); -put_online_cpus (); +cpus_read_unlock (); }return 0 ; --
Applied as 5.15 material, thanks!
PATCH 30/38 ACPI: PM: s2idle: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/power/suspend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/power/suspend.c +2 -2
@@ -96,7 +96,7 @@ static void s2idle_enter(void) s2idle_state =S2IDLE_STATE_ENTER ;raw_spin_unlock_irq (&s2idle_lock); -get_online_cpus (); +cpus_read_lock ();cpuidle_resume ();/* Push all the CPUs into the idle loop. */
@@ -106,7 +106,7 @@ static void s2idle_enter(void) s2idle_state == S2IDLE_STATE_WAKE);cpuidle_pause (); -put_online_cpus (); +cpus_read_unlock ();raw_spin_lock_irq (&s2idle_lock);
Signature · 1 line
2.32.0
Re: [PATCH 30/38] ACPI: PM: s2idle: Replace deprecated CPU-hotplug functions.
Quoted 31 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc "Rafael J. Wysocki" <[email protected]>Cc Pavel Machek <[email protected]>Cc Len Brown <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>--- kernel/power/suspend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/power/suspend.c +1
-1@@ -96,7 +96,7 @@ static void s2idle_enter(void) s2idle_state =S2IDLE_STATE_ENTER ;raw_spin_unlock_irq (&s2idle_lock); -get_online_cpus (); +cpus_read_lock ();cpuidle_resume ();/* Push all the CPUs into the idle loop. */
kernel/power/suspend.c static void s2idle_enter(void)
Quoted 9 lines
kernel/power/suspend.c +1
-2@@ -106,7 +106,7 @@ static void s2idle_enter(void) s2idle_state == S2IDLE_STATE_WAKE);cpuidle_pause (); -put_online_cpus (); +cpus_read_unlock ();raw_spin_lock_irq (&s2idle_lock); --
Applied as 5.15 material, but the subject changed to "PM: sleep:
s2idle: Replace deprecated CPU-hotplug functions".
Thanks!
PATCH 31/38 rcu: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/rcu/tree.c +2 -2
@@ -4050,7 +4050,7 @@ void rcu_barrier(void)*/ init_completion (&rcu_state.barrier_completion);atomic_set (&rcu_state.barrier_cpu_count,2 ); -get_online_cpus (); +cpus_read_lock ();/* * Force each CPU with callbacks to register a new callback.
@@ -4081,7 +4081,7 @@ void rcu_barrier(void) rcu_state.barrier_sequence); } } -put_online_cpus (); +cpus_read_unlock ();/* * Now that we have an rcu_barrier_callback() callback on each
Signature · 1 line
2.32.0
Re: [PATCH 31/38] rcu: Replace deprecated CPU-hotplug functions.
Quoted 7 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Quoted 8 lines
Cc "Paul E. McKenney" <[email protected]>Cc Josh Triplett <[email protected]>Cc Steven Rostedt <[email protected]>Cc Mathieu Desnoyers <[email protected]>Cc Lai Jiangshan <[email protected]>Cc Joel Fernandes <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
I have queued this one and 35/38 (rcutorture) for v5.16. If you would prefer to send them some other route, please let me know and:
Quoted 29 lines
--- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/rcu/tree.c +2
-2@@ -4050,7 +4050,7 @@ void rcu_barrier(void)*/ init_completion (&rcu_state.barrier_completion);atomic_set (&rcu_state.barrier_cpu_count,2 ); -get_online_cpus (); +cpus_read_lock ();/* * Force each CPU with callbacks to register a new callback. @@ -4081,7 +4081,7 @@ void rcu_barrier(void) rcu_state.barrier_sequence); } } -put_online_cpus (); +cpus_read_unlock ();/* * Now that we have an rcu_barrier_callback() callback on each Signature · 1 line
2.32.0
Re: [PATCH 31/38] rcu: Replace deprecated CPU-hotplug functions.
Quoted 10 lines · Paul E. McKenney
Quoted 7 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
I have queued this one and 35/38 (rcutorture) for v5.16. If you would prefer to send them some other route, please let me know and:
5.15 would be appreciated so we can get rid of the old interface around rc1.
Thanks,
tglx
Paul E. McKenney
maintainerRe: [PATCH 31/38] rcu: Replace deprecated CPU-hotplug functions.
Quoted 6 lines · Thomas Gleixner
Quoted 5 lines · Paul E. McKenney
Quoted 4 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
I have queued this one and 35/38 (rcutorture) for v5.16. If you would prefer to send them some other route, please let me know and:
5.15 would be appreciated so we can get rid of the old interface around rc1.
Fair enough! I have rebased to pull those two patches into my v5.15 pile.
Thanx, Paul
PATCH 32/38 sched: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/sched/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/core.c +2 -2
@@ -9824,7 +9824,7 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota,* Prevent race between setting of cfs_rq->runtime_enabled and * unthrottle_offline_cfs_rqs(). */ -get_online_cpus (); +cpus_read_lock ();mutex_lock (&cfs_constraints_mutex); ret =__cfs_schedulable (tg, period, quota);if (ret)
@@ -9868,7 +9868,7 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota,cfs_bandwidth_usage_dec (); out_unlock:mutex_unlock (&cfs_constraints_mutex); -put_online_cpus (); +cpus_read_unlock ();return ret; }
Signature · 1 line
2.32.0
[tip: sched/core] sched: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 746f5ea9c4283d98353c1cd41864aec475e0edbd Gitweb: https://git.kernel.org/tip/746f5ea9c4283d98353c1cd41864aec475e0edbd Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:15 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 14:53:00 +02:00
sched: 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.
--- kernel/sched/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/core.c +2 -2
@@ -9840,7 +9840,7 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota,* Prevent race between setting of cfs_rq->runtime_enabled and * unthrottle_offline_cfs_rqs(). */ -get_online_cpus (); +cpus_read_lock ();mutex_lock (&cfs_constraints_mutex); ret =__cfs_schedulable (tg, period, quota);if (ret)
@@ -9884,7 +9884,7 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota,cfs_bandwidth_usage_dec (); out_unlock:mutex_unlock (&cfs_constraints_mutex); -put_online_cpus (); +cpus_read_unlock ();return ret; }
PATCH 33/38 smpboot: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/smpboot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/smpboot.c +4 -4
@@ -291,7 +291,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)unsigned int cpu;int ret =0 ; -get_online_cpus (); +cpus_read_lock ();mutex_lock (&smpboot_threads_lock);for_each_online_cpu (cpu) { ret =__smpboot_create_thread (plug_thread, cpu);
@@ -304,7 +304,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)list_add (&plug_thread->list, &hotplug_threads); out:mutex_unlock (&smpboot_threads_lock); -put_online_cpus (); +cpus_read_unlock ();return ret; }EXPORT_SYMBOL_GPL (smpboot_register_percpu_thread);
@@ -317,12 +317,12 @@ EXPORT_SYMBOL_GPL(smpboot_register_percpu_thread);*/ void smpboot_unregister_percpu_thread (struct smp_hotplug_thread *plug_thread) { -get_online_cpus (); +cpus_read_lock ();mutex_lock (&smpboot_threads_lock);list_del (&plug_thread->list);smpboot_destroy_threads (plug_thread);mutex_unlock (&smpboot_threads_lock); -put_online_cpus (); +cpus_read_unlock (); }EXPORT_SYMBOL_GPL (smpboot_unregister_percpu_thread);
Signature · 1 line
2.32.0
[tip: smp/core] smpboot: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the smp/core branch of tip:
The following commit has been merged into the smp/core branch of tip:
Commit-ID: 844d87871b6e0ac3ceb177535dcdf6e6a9f1fd4b Gitweb: https://git.kernel.org/tip/844d87871b6e0ac3ceb177535dcdf6e6a9f1fd4b Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:16 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 14:57:42 +02:00
smpboot: 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.
--- kernel/smpboot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/smpboot.c +4 -4
@@ -291,7 +291,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)unsigned int cpu;int ret =0 ; -get_online_cpus (); +cpus_read_lock ();mutex_lock (&smpboot_threads_lock);for_each_online_cpu (cpu) { ret =__smpboot_create_thread (plug_thread, cpu);
@@ -304,7 +304,7 @@ int smpboot_register_percpu_thread(struct smp_hotplug_thread *plug_thread)list_add (&plug_thread->list, &hotplug_threads); out:mutex_unlock (&smpboot_threads_lock); -put_online_cpus (); +cpus_read_unlock ();return ret; }EXPORT_SYMBOL_GPL (smpboot_register_percpu_thread);
@@ -317,12 +317,12 @@ EXPORT_SYMBOL_GPL(smpboot_register_percpu_thread);*/ void smpboot_unregister_percpu_thread (struct smp_hotplug_thread *plug_thread) { -get_online_cpus (); +cpus_read_lock ();mutex_lock (&smpboot_threads_lock);list_del (&plug_thread->list);smpboot_destroy_threads (plug_thread);mutex_unlock (&smpboot_threads_lock); -put_online_cpus (); +cpus_read_unlock (); }EXPORT_SYMBOL_GPL (smpboot_unregister_percpu_thread);
PATCH 34/38 clocksource: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/time/clocksource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/time/clocksource.c +3 -3
@@ -306,12 +306,12 @@ void clocksource_verify_percpu(struct clocksource *cs)return ;cpumask_clear (&cpus_ahead);cpumask_clear (&cpus_behind); -get_online_cpus (); +cpus_read_lock ();preempt_disable ();clocksource_verify_choose_cpus ();if (cpumask_weight (&cpus_chosen) ==0 ) {preempt_enable (); -put_online_cpus (); +cpus_read_unlock ();pr_warn ("Not enough CPUs to check clocksource '%s'.\n" , cs->name);return ; }
@@ -337,7 +337,7 @@ void clocksource_verify_percpu(struct clocksource *cs) cs_nsec_min = cs_nsec; }preempt_enable (); -put_online_cpus (); +cpus_read_unlock ();if (!cpumask_empty (&cpus_ahead))pr_warn (" CPUs %*pbl ahead of CPU %d for clocksource %s.\n" ,cpumask_pr_args (&cpus_ahead), testcpu, cs->name);
Signature · 1 line
2.32.0
[tip: timers/core] clocksource: Replace deprecated CPU-hotplug functions.
The following commit has been merged into the timers/core branch of tip:
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 698429f9d0e54ce3964151adff886ee5fc59714b Gitweb: https://git.kernel.org/tip/698429f9d0e54ce3964151adff886ee5fc59714b Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:17 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 10 Aug 2021 14:53:58 +02:00
clocksource: 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.
--- kernel/time/clocksource.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/time/clocksource.c +3 -3
@@ -306,12 +306,12 @@ void clocksource_verify_percpu(struct clocksource *cs)return ;cpumask_clear (&cpus_ahead);cpumask_clear (&cpus_behind); -get_online_cpus (); +cpus_read_lock ();preempt_disable ();clocksource_verify_choose_cpus ();if (cpumask_weight (&cpus_chosen) ==0 ) {preempt_enable (); -put_online_cpus (); +cpus_read_unlock ();pr_warn ("Not enough CPUs to check clocksource '%s'.\n" , cs->name);return ; }
@@ -337,7 +337,7 @@ void clocksource_verify_percpu(struct clocksource *cs) cs_nsec_min = cs_nsec; }preempt_enable (); -put_online_cpus (); +cpus_read_unlock ();if (!cpumask_empty (&cpus_ahead))pr_warn (" CPUs %*pbl ahead of CPU %d for clocksource %s.\n" ,cpumask_pr_args (&cpus_ahead), testcpu, cs->name);
PATCH 35/38 torture: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/torture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/torture.c +3 -3
@@ -521,11 +521,11 @@ static void torture_shuffle_tasks(void)struct shuffle_task *stp;cpumask_setall (shuffle_tmp_mask); -get_online_cpus (); +cpus_read_lock ();/* No point in shuffling if there is only one online CPU (ex: UP) */ if (num_online_cpus () ==1 ) { -put_online_cpus (); +cpus_read_unlock ();return ; }
@@ -541,7 +541,7 @@ static void torture_shuffle_tasks(void)set_cpus_allowed_ptr (stp->st_t, shuffle_tmp_mask);mutex_unlock (&shuffle_task_mutex); -put_online_cpus (); +cpus_read_unlock (); }/* Shuffle tasks across CPUs, with the intent of allowing each CPU in the
Signature · 1 line
2.32.0
PATCH 36/38 tracing: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/trace/ring_buffer.c | 8 ++++---- kernel/trace/trace_hwlat.c | 28 ++++++++++++++-------------- kernel/trace/trace_osnoise.c | 16 ++++++++-------- 3 files changed, 26 insertions(+), 26 deletions(-)
kernel/trace/ring_buffer.c +4 -4
@@ -2111,7 +2111,7 @@ int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size, } } -get_online_cpus (); +cpus_read_lock ();/* * Fire off all the required work handlers * We can't schedule on offline CPUs, but it's not necessary
@@ -2143,7 +2143,7 @@ int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size, cpu_buffer->nr_pages_to_update =0 ; } -put_online_cpus (); +cpus_read_unlock (); }else { cpu_buffer = buffer->buffers[cpu_id];
@@ -2171,7 +2171,7 @@ int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size, goto out_err; } -get_online_cpus (); +cpus_read_lock ();/* Can't run something on an offline CPU. */ if (!cpu_online (cpu_id))
@@ -2183,7 +2183,7 @@ int ring_buffer_resize(struct trace_buffer *buffer, unsigned long size, } cpu_buffer->nr_pages_to_update =0 ; -put_online_cpus (); +cpus_read_unlock (); } out:
kernel/trace/trace_hwlat.c +14 -14
@@ -325,10 +325,10 @@ static void move_to_next_cpu(void)if (!cpumask_equal (current_mask, current->cpus_ptr)) goto change_mode; -get_online_cpus (); +cpus_read_lock ();cpumask_and (current_mask, cpu_online_mask, tr->tracing_cpumask); next_cpu =cpumask_next (smp_processor_id (), current_mask); -put_online_cpus (); +cpus_read_unlock ();if (next_cpu >= nr_cpu_ids) next_cpu =cpumask_first (current_mask);
@@ -398,7 +398,7 @@ static void stop_single_kthread(void)struct hwlat_kthread_data *kdata =get_cpu_data ();struct task_struct *kthread; -get_online_cpus (); +cpus_read_lock (); kthread = kdata->kthread;if (!kthread)
@@ -408,7 +408,7 @@ static void stop_single_kthread(void) kdata->kthread =NULL ; out_put_cpus: -put_online_cpus (); +cpus_read_unlock (); }
@@ -425,14 +425,14 @@ static int start_single_kthread(struct trace_array *tr)struct task_struct *kthread;int next_cpu; -get_online_cpus (); +cpus_read_lock ();if (kdata->kthread) goto out_put_cpus; kthread =kthread_create (kthread_fn,NULL ,"hwlatd" );if (IS_ERR (kthread)) {pr_err (BANNER "could not start sampling thread\n" ); -put_online_cpus (); +cpus_read_unlock ();return -ENOMEM ; }
@@ -452,7 +452,7 @@ static int start_single_kthread(struct trace_array *tr)wake_up_process (kthread); out_put_cpus: -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
@@ -479,10 +479,10 @@ static void stop_per_cpu_kthreads(void) {unsigned int cpu; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu)stop_cpu_kthread (cpu); -put_online_cpus (); +cpus_read_unlock (); }/*
@@ -515,7 +515,7 @@ static void hwlat_hotplug_workfn(struct work_struct *dummy)mutex_lock (&trace_types_lock);mutex_lock (&hwlat_data.lock); -get_online_cpus (); +cpus_read_lock ();if (!hwlat_busy || hwlat_data.thread_mode !=MODE_PER_CPU ) goto out_unlock;
@@ -526,7 +526,7 @@ static void hwlat_hotplug_workfn(struct work_struct *dummy)start_cpu_kthread (cpu); out_unlock: -put_online_cpus (); +cpus_read_unlock ();mutex_unlock (&hwlat_data.lock);mutex_unlock (&trace_types_lock); }
@@ -582,7 +582,7 @@ static int start_per_cpu_kthreads(struct trace_array *tr)unsigned int cpu;int retval; -get_online_cpus (); +cpus_read_lock ();/* * Run only on CPUs in which hwlat is allowed to run. */
@@ -596,12 +596,12 @@ static int start_per_cpu_kthreads(struct trace_array *tr)if (retval) goto out_error; } -put_online_cpus (); +cpus_read_unlock ();return 0 ; out_error: -put_online_cpus (); +cpus_read_unlock ();stop_per_cpu_kthreads ();return retval; }
kernel/trace/trace_osnoise.c +8 -8
@@ -1444,12 +1444,12 @@ static void stop_per_cpu_kthreads(void) {int cpu; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu)stop_kthread (cpu); -put_online_cpus (); +cpus_read_unlock (); }/*
@@ -1497,7 +1497,7 @@ static int start_per_cpu_kthreads(struct trace_array *tr)int retval;int cpu; -get_online_cpus (); +cpus_read_lock ();/* * Run only on CPUs in which trace and osnoise are allowed to run. */
@@ -1518,7 +1518,7 @@ static int start_per_cpu_kthreads(struct trace_array *tr) } } -put_online_cpus (); +cpus_read_unlock ();return 0 ; }
@@ -1536,7 +1536,7 @@ static void osnoise_hotplug_workfn(struct work_struct *dummy) goto out_unlock_trace;mutex_lock (&interface_lock); -get_online_cpus (); +cpus_read_lock ();if (!cpumask_test_cpu (cpu, &osnoise_cpumask)) goto out_unlock;
@@ -1547,7 +1547,7 @@ static void osnoise_hotplug_workfn(struct work_struct *dummy)start_kthread (cpu); out_unlock: -put_online_cpus (); +cpus_read_unlock ();mutex_unlock (&interface_lock); out_unlock_trace:mutex_unlock (&trace_types_lock);
@@ -1689,11 +1689,11 @@ osnoise_cpus_write(struct file *filp, const char __user *ubuf, size_t count,/* * osnoise_cpumask is read by CPU hotplug operations. */ -get_online_cpus (); +cpus_read_lock ();cpumask_copy (&osnoise_cpumask, osnoise_cpumask_new); -put_online_cpus (); +cpus_read_unlock ();mutex_unlock (&interface_lock);if (running)
Signature · 1 line
2.32.0
Re: [PATCH 36/38] tracing: Replace deprecated CPU-hotplug functions.
Quoted 10 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Steven Rostedt <[email protected]>Cc Ingo Molnar <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
osnoise/timerlat/hwlat tested and it looks good to me.
Thanks
-- Daniel
Re: [PATCH 36/38] tracing: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorQuoted 8 lines · On Tue, 3 Aug 2021 16:16:19 +0200 Sebastian Andrzej Siewior…
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Steven Rostedt <[email protected]>
-- Steve
Quoted 4 lines
Cc Ingo Molnar <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>---
Re: [PATCH 36/38] tracing: Replace deprecated CPU-hotplug functions.
Quoted 1 line · Steven Rostedt
Reviewed-by Steven Rostedt (VMware) <[email protected]>
Steven, could you please route this via your tracing tree?
Quoted 1 line
-- Steve
Sebastian
Steven Rostedt
maintainerRe: [PATCH 36/38] tracing: Replace deprecated CPU-hotplug functions.
Quoted 5 lines · On Tue, 10 Aug 2021 15:34:01 +0200 Sebastian Andrzej Siewior…
Quoted 1 line · Steven Rostedt
Reviewed-by Steven Rostedt (VMware) <[email protected]>Steven, could you please route this via your tracing tree?
Sure, will do.
-- Steve
PATCH 37/38 workqueue: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorThe 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.
--- kernel/workqueue.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
kernel/workqueue.c +11 -11
@@ -3293,7 +3293,7 @@ int schedule_on_each_cpu(work_func_t func)if (!works)return -ENOMEM ; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {struct work_struct *work =per_cpu_ptr (works, cpu);
@@ -3305,7 +3305,7 @@ int schedule_on_each_cpu(work_func_t func)for_each_online_cpu (cpu)flush_work (per_cpu_ptr (works, cpu)); -put_online_cpus (); +cpus_read_unlock ();free_percpu (works);return 0 ; }
@@ -4016,14 +4016,14 @@ static void apply_wqattrs_commit(struct apply_wqattrs_ctx *ctx)static void apply_wqattrs_lock (void ) {/* CPUs should stay stable across pwq creations and installations */ -get_online_cpus (); +cpus_read_lock ();mutex_lock (&wq_pool_mutex); }static void apply_wqattrs_unlock (void ) {mutex_unlock (&wq_pool_mutex); -put_online_cpus (); +cpus_read_unlock (); } static int apply_workqueue_attrs_locked(struct workqueue_struct *wq,
@@ -4068,7 +4068,7 @@ static int apply_workqueue_attrs_locked(struct workqueue_struct *wq,* * Performs GFP_KERNEL allocations. * -* Assumes caller has CPU hotplug read exclusion, i.e. get_online_cpus(). +* Assumes caller has CPU hotplug read exclusion, i.e. cpus_read_lock(). * * Return: 0 on success and -errno on failure. */
@@ -4196,7 +4196,7 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)return 0 ; } -get_online_cpus (); +cpus_read_lock ();if (wq->flags & __WQ_ORDERED) { ret =apply_workqueue_attrs (wq, ordered_wq_attrs[highpri]);/* there should only be single pwq for ordering guarantee */
@@ -4206,7 +4206,7 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq) }else { ret =apply_workqueue_attrs (wq, unbound_std_wq_attrs[highpri]); } -put_online_cpus (); +cpus_read_unlock ();return ret; }
@@ -5168,10 +5168,10 @@ long work_on_cpu_safe(int cpu, long (*fn)(void *), void *arg) {long ret = -ENODEV ; -get_online_cpus (); +cpus_read_lock ();if (cpu_online (cpu)) ret =work_on_cpu (cpu, fn, arg); -put_online_cpus (); +cpus_read_unlock ();return ret; }EXPORT_SYMBOL_GPL (work_on_cpu_safe);
@@ -5443,7 +5443,7 @@ static ssize_t wq_pool_ids_show(struct device *dev,const char *delim ="" ;int node, written =0 ; -get_online_cpus (); +cpus_read_lock ();rcu_read_lock ();for_each_node (node) { written += scnprintf(buf + written, PAGE_SIZE - written,
@@ -5453,7 +5453,7 @@ static ssize_t wq_pool_ids_show(struct device *dev, } written +=scnprintf (buf + written,PAGE_SIZE - written,"\n" );rcu_read_unlock (); -put_online_cpus (); +cpus_read_unlock ();return written; }
Signature · 1 line
2.32.0
Re: [PATCH 37/38] workqueue: Replace deprecated CPU-hotplug functions.
Quoted 5 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().
Quoted 7 lines
Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Tejun Heo <[email protected]>Cc Lai Jiangshan <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>---
Quoted 103 lines
kernel/workqueue.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)kernel/workqueue.c +11
-12@@ -3293,7 +3293,7 @@ int schedule_on_each_cpu(work_func_t func)if (!works)return -ENOMEM ; -get_online_cpus (); +cpus_read_lock ();for_each_online_cpu (cpu) {struct work_struct *work =per_cpu_ptr (works, cpu);@@ -3305,7 +3305,7 @@ int schedule_on_each_cpu(work_func_t func)for_each_online_cpu (cpu)flush_work (per_cpu_ptr (works, cpu)); -put_online_cpus (); +cpus_read_unlock ();free_percpu (works);return 0 ; }@@ -4016,14 +4016,14 @@ static void apply_wqattrs_commit(struct apply_wqattrs_ctx *ctx)static void apply_wqattrs_lock (void ) {/* CPUs should stay stable across pwq creations and installations */ -get_online_cpus (); +cpus_read_lock ();mutex_lock (&wq_pool_mutex); }static void apply_wqattrs_unlock (void ) {mutex_unlock (&wq_pool_mutex); -put_online_cpus (); +cpus_read_unlock (); } static int apply_workqueue_attrs_locked(struct workqueue_struct *wq,@@ -4068,7 +4068,7 @@ static int apply_workqueue_attrs_locked(struct workqueue_struct *wq,* * Performs GFP_KERNEL allocations. * -* Assumes caller has CPU hotplug read exclusion, i.e. get_online_cpus(). +* Assumes caller has CPU hotplug read exclusion, i.e. cpus_read_lock(). * * Return: 0 on success and -errno on failure. */ @@ -4196,7 +4196,7 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)return 0 ; } -get_online_cpus (); +cpus_read_lock ();if (wq->flags & __WQ_ORDERED) { ret =apply_workqueue_attrs (wq, ordered_wq_attrs[highpri]);/* there should only be single pwq for ordering guarantee */ @@ -4206,7 +4206,7 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq) }else { ret =apply_workqueue_attrs (wq, unbound_std_wq_attrs[highpri]); } -put_online_cpus (); +cpus_read_unlock ();return ret; }@@ -5168,10 +5168,10 @@ long work_on_cpu_safe(int cpu, long (*fn)(void *), void *arg) {long ret = -ENODEV ; -get_online_cpus (); +cpus_read_lock ();if (cpu_online (cpu)) ret =work_on_cpu (cpu, fn, arg); -put_online_cpus (); +cpus_read_unlock ();return ret; }EXPORT_SYMBOL_GPL (work_on_cpu_safe);@@ -5443,7 +5443,7 @@ static ssize_t wq_pool_ids_show(struct device *dev,const char *delim ="" ;int node, written =0 ; -get_online_cpus (); +cpus_read_lock ();rcu_read_lock ();for_each_node (node) { written += scnprintf(buf + written, PAGE_SIZE - written,@@ -5453,7 +5453,7 @@ static ssize_t wq_pool_ids_show(struct device *dev, } written +=scnprintf (buf + written,PAGE_SIZE - written,"\n" );rcu_read_unlock (); -put_online_cpus (); +cpus_read_unlock ();return written; } --2.32.0
Re: [PATCH 37/38] workqueue: Replace deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorQuoted 10 lines · Sebastian Andrzej Siewior
The functions
get_online_cpus()andput_online_cpus()have been deprecated during the CPU hotplug rework. They map directly tocpus_read_lock()andcpus_read_unlock().Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged.
Cc Tejun Heo <[email protected]>Cc Lai Jiangshan <[email protected]>Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Applied to cgroup/for-5.15.
Thanks.
Signature · 1 line
tejun
PATCH 38/38 cpu/hotplug: Remove deprecated CPU-hotplug functions.
In reply to Sebastian Andrzej SiewiorNo users in tree use the deprecated CPU-hotplug functions.
Remove them.
--- include/linux/cpu.h | 6 ------ 1 file changed, 6 deletions(-)
include/linux/cpu.h +0 -6
@@ -143,12 +143,6 @@ static inline int remove_cpu(unsigned int cpu) { return -EPERM; }static inline void smp_shutdown_nonboot_cpus (unsigned int primary_cpu) { }#endif /* !CONFIG_HOTPLUG_CPU */ -/* Wrappers which go away once all code is converted */ -static inline void cpu_hotplug_begin (void ) {cpus_write_lock (); } -static inline void cpu_hotplug_done (void ) {cpus_write_unlock (); } -static inline void get_online_cpus (void ) {cpus_read_lock (); } -static inline void put_online_cpus (void ) {cpus_read_unlock (); } -#ifdef CONFIG_PM_SLEEP_SMP extern int freeze_secondary_cpus (int primary);extern void thaw_secondary_cpus (void );
Signature · 1 line
2.32.0
[tip: smp/urgent] cpu/hotplug: Remove deprecated CPU-hotplug functions.
The following commit has been merged into the smp/urgent branch of tip:
The following commit has been merged into the smp/urgent branch of tip:
Commit-ID: 8c854303ce0e38e5bbedd725ff39da7e235865d8 Gitweb: https://git.kernel.org/tip/8c854303ce0e38e5bbedd725ff39da7e235865d8 Author: Sebastian Andrzej Siewior <[email protected]> AuthorDate: Tue, 03 Aug 2021 16:16:21 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sat, 11 Sep 2021 00:41:21 +02:00
cpu/hotplug: Remove deprecated CPU-hotplug functions.
No users in tree use the deprecated CPU-hotplug functions anymore.
Remove them.
--- include/linux/cpu.h | 6 ------ 1 file changed, 6 deletions(-)
include/linux/cpu.h +0 -6
@@ -143,12 +143,6 @@ static inline int remove_cpu(unsigned int cpu) { return -EPERM; }static inline void smp_shutdown_nonboot_cpus (unsigned int primary_cpu) { }#endif /* !CONFIG_HOTPLUG_CPU */ -/* Wrappers which go away once all code is converted */ -static inline void cpu_hotplug_begin (void ) {cpus_write_lock (); } -static inline void cpu_hotplug_done (void ) {cpus_write_unlock (); } -static inline void get_online_cpus (void ) {cpus_read_lock (); } -static inline void put_online_cpus (void ) {cpus_read_unlock (); } -#ifdef CONFIG_PM_SLEEP_SMP extern int freeze_secondary_cpus (int primary);extern void thaw_secondary_cpus (void );
Hi Sebastien,
Quoted 4 lines · Sebastian Andrzej Siewior
This is a tree wide replacement of the deprecated CPU hotplug functions which are only wrappers around the actual functions.
Each patch is independent and can be picked up by the relevant maintainer.
Ok; and I take it that then also is the plan for merging these ?
FWIW I'm fine with the drivers/platform/x86 patch going upstream through some other tree if its easier to keep the set together ...
Regards,
Hans
Quoted 109 lines
Cc Alexander Shishkin <[email protected]>Cc Amit Kucheria <[email protected]>Cc Andrew Morton <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Arnd Bergmann <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc Ben Segall <[email protected]>Cc Borislav Petkov <[email protected]>Cc Christian Borntraeger <[email protected]>Cc Daniel Bristot de Oliveira <[email protected]>Cc Daniel Jordan <[email protected]>Cc Daniel Lezcano <[email protected]>Cc Dave Hansen <[email protected]>Cc Davidlohr Bueso <[email protected]>Cc "David S. Miller" <[email protected]>Cc Dietmar Eggemann <[email protected]>Cc Gonglei <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Guenter Roeck <[email protected]>Cc Hans de Goede <[email protected]>Cc Heiko Carstens <[email protected]>Cc Herbert Xu <[email protected]>Cc "H. Peter Anvin" <[email protected]>Cc Ingo Molnar <[email protected]>Cc Ingo Molnar <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Jason Wang <[email protected]>Cc Jean Delvare <[email protected]>Cc Jiri Kosina <[email protected]>Cc Jiri Olsa <[email protected]>Cc Joe Lawrence <[email protected]>Cc Joel Fernandes <[email protected]>Cc Johannes Weiner <[email protected]>Cc John Stultz <[email protected]>Cc Jonathan Corbet <[email protected]>Cc Josh Poimboeuf <[email protected]>Cc Josh Triplett <[email protected]>Cc Julian Wiedmann <[email protected]>Cc Juri Lelli <[email protected]>Cc Karol Herbst <[email protected]>Cc Karsten Graul <[email protected]>Cc Lai Jiangshan <[email protected]>Cc Len Brown <[email protected]>Cc Len Brown <[email protected]>Cc Leo Yan <[email protected]>Cc Mark Gross <[email protected]>Cc Mark Rutland <[email protected]>Cc Mathieu Desnoyers <[email protected]>Cc Mathieu Poirier <[email protected]>Cc Mel Gorman <[email protected]>Cc Michael Ellerman <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Mike Leach <[email protected]>Cc Mike Travis <[email protected]>Cc Miroslav Benes <[email protected]>Cc Namhyung Kim <[email protected]>Cc "Paul E. McKenney" <[email protected]>Cc Paul Mackerras <[email protected]>Cc Pavel Machek <[email protected]>Cc Pekka Paalanen <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Petr Mladek <[email protected]>Cc "Rafael J. Wysocki" <[email protected]>Cc Robin Holt <[email protected]>Cc Song Liu <[email protected]>Cc Srinivas Pandruvada <[email protected]>Cc Steffen Klassert <[email protected]>Cc Stephen Boyd <[email protected]>Cc Steven Rostedt <[email protected]>Cc Steve Wahl <[email protected]>Cc Stuart Hayes <[email protected]>Cc Suzuki K Poulose <[email protected]>Cc Tejun Heo <[email protected]>Cc Thomas Bogendoerfer <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Tony Luck <[email protected]>Cc Vasily Gorbik <[email protected]>Cc Vincent Guittot <[email protected]>Cc Viresh Kumar <[email protected]>Cc Zefan Li <[email protected]>Cc Zhang Rui <[email protected]>Sebastian
Quoted 1 line · Hans de Goede
Hi Sebastien,
Hi Hans,
Quoted 10 lines · Sebastian Andrzej Siewior
Quoted 4 lines
This is a tree wide replacement of the deprecated CPU hotplug functions which are only wrappers around the actual functions.
Each patch is independent and can be picked up by the relevant maintainer.
Ok; and I take it that then also is the plan for merging these ?
FWIW I'm fine with the
drivers/platform/x86patch going upstream through some other tree if its easier to keep the set together ...
There is no need to keep that set together since each patch is independent. Please merge it through your tree.
Quoted 3 lines
Regards,
Hans
Sebastian
Michael Ellerman
AppliedRe: (subset) [PATCH 00/38] Replace deprecated CPU-hotplug
In reply to Sebastian Andrzej SiewiorQuoted 6 lines · Sebastian Andrzej Siewior
This is a tree wide replacement of the deprecated CPU hotplug functions which are only wrappers around the actual functions.
Each patch is independent and can be picked up by the relevant maintainer.
[...]
Applied to powerpc/next.
[03/38] powerpc: Replace deprecated CPU-hotplug functions.
https://git.kernel.org/powerpc/c/5ae36401ca4ea2737d779ce7c267444b16530001
cheers