Commit 7625eccd authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Thomas Gleixner

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.
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210803141621.780504-21-bigeasy@linutronix.de
parent 252034e0
...@@ -70,9 +70,9 @@ void disable_swap_slots_cache_lock(void) ...@@ -70,9 +70,9 @@ void disable_swap_slots_cache_lock(void)
swap_slot_cache_enabled = false; swap_slot_cache_enabled = false;
if (swap_slot_cache_initialized) { if (swap_slot_cache_initialized) {
/* serialize with cpu hotplug operations */ /* serialize with cpu hotplug operations */
get_online_cpus(); cpus_read_lock();
__drain_swap_slots_cache(SLOTS_CACHE|SLOTS_CACHE_RET); __drain_swap_slots_cache(SLOTS_CACHE|SLOTS_CACHE_RET);
put_online_cpus(); cpus_read_unlock();
} }
} }
......
...@@ -129,9 +129,9 @@ static void sum_vm_events(unsigned long *ret) ...@@ -129,9 +129,9 @@ static void sum_vm_events(unsigned long *ret)
*/ */
void all_vm_events(unsigned long *ret) void all_vm_events(unsigned long *ret)
{ {
get_online_cpus(); cpus_read_lock();
sum_vm_events(ret); sum_vm_events(ret);
put_online_cpus(); cpus_read_unlock();
} }
EXPORT_SYMBOL_GPL(all_vm_events); EXPORT_SYMBOL_GPL(all_vm_events);
...@@ -1948,7 +1948,7 @@ static void vmstat_shepherd(struct work_struct *w) ...@@ -1948,7 +1948,7 @@ static void vmstat_shepherd(struct work_struct *w)
{ {
int cpu; int cpu;
get_online_cpus(); cpus_read_lock();
/* Check processors whose vmstat worker threads have been disabled */ /* Check processors whose vmstat worker threads have been disabled */
for_each_online_cpu(cpu) { for_each_online_cpu(cpu) {
struct delayed_work *dw = &per_cpu(vmstat_work, cpu); struct delayed_work *dw = &per_cpu(vmstat_work, cpu);
...@@ -1958,7 +1958,7 @@ static void vmstat_shepherd(struct work_struct *w) ...@@ -1958,7 +1958,7 @@ static void vmstat_shepherd(struct work_struct *w)
cond_resched(); cond_resched();
} }
put_online_cpus(); cpus_read_unlock();
schedule_delayed_work(&shepherd, schedule_delayed_work(&shepherd,
round_jiffies_relative(sysctl_stat_interval)); round_jiffies_relative(sysctl_stat_interval));
...@@ -2037,9 +2037,9 @@ void __init init_mm_internals(void) ...@@ -2037,9 +2037,9 @@ void __init init_mm_internals(void)
if (ret < 0) if (ret < 0)
pr_err("vmstat: failed to register 'online' hotplug state\n"); pr_err("vmstat: failed to register 'online' hotplug state\n");
get_online_cpus(); cpus_read_lock();
init_cpu_node_state(); init_cpu_node_state();
put_online_cpus(); cpus_read_unlock();
start_shepherd_timer(); start_shepherd_timer();
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment