]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpumask: deprecate cpumask_next_wrap()
authorYury Norov <yury.norov@gmail.com>
Tue, 28 Jan 2025 16:46:34 +0000 (11:46 -0500)
committerYury Norov <yury.norov@gmail.com>
Mon, 24 Feb 2025 21:37:22 +0000 (16:37 -0500)
The next patch aligns implementation of cpumask_next_wrap() with the
find_next_bit_wrap(), and it changes function signature.

To make the transition smooth, this patch deprecates current
implementation by adding an _old suffix. The following patches switch
current users to the new implementation one by one.

No functional changes were intended.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
arch/s390/kernel/processor.c
drivers/pci/controller/pci-hyperv.c
drivers/scsi/lpfc/lpfc_init.c
include/linux/cpumask.h
kernel/padata.c
lib/cpumask.c

index 5ce9a795a0fe1b4f3d2afd03e1093b1642308a3a..42ca61909030a32b69a4c1568b2aaf8b2b10cf53 100644 (file)
@@ -72,7 +72,7 @@ void notrace stop_machine_yield(const struct cpumask *cpumask)
        this_cpu = smp_processor_id();
        if (__this_cpu_inc_return(cpu_relax_retry) >= spin_retry) {
                __this_cpu_write(cpu_relax_retry, 0);
-               cpu = cpumask_next_wrap(this_cpu, cpumask, this_cpu, false);
+               cpu = cpumask_next_wrap_old(this_cpu, cpumask, this_cpu, false);
                if (cpu >= nr_cpu_ids)
                        return;
                if (arch_vcpu_is_preempted(cpu))
index 6084b38bdda17a8ad622108158692ffc72bf3377..c39316966de53be340fef07179ff3544f19cd72f 100644 (file)
@@ -1757,7 +1757,7 @@ static int hv_compose_multi_msi_req_get_cpu(void)
 
        spin_lock_irqsave(&multi_msi_cpu_lock, flags);
 
-       cpu_next = cpumask_next_wrap(cpu_next, cpu_online_mask, nr_cpu_ids,
+       cpu_next = cpumask_next_wrap_old(cpu_next, cpu_online_mask, nr_cpu_ids,
                                     false);
        cpu = cpu_next;
 
index bcadf11414c8a41d6fc99d03586d55c26d0a6a0f..5f75319c8f95d643ebac814aebd1bd2157d59525 100644 (file)
@@ -12873,7 +12873,7 @@ lpfc_irq_rebalance(struct lpfc_hba *phba, unsigned int cpu, bool offline)
 
        if (offline) {
                /* Find next online CPU on original mask */
-               cpu_next = cpumask_next_wrap(cpu, orig_mask, cpu, true);
+               cpu_next = cpumask_next_wrap_old(cpu, orig_mask, cpu, true);
                cpu_select = lpfc_next_online_cpu(orig_mask, cpu_next);
 
                /* Found a valid CPU */
index e57fd41ca38e9cda68e8145170c18fd0aa429e25..7f7f17cfd21d57ef4a4a7e2a3356fec6dafc0f51 100644 (file)
@@ -296,7 +296,7 @@ unsigned int cpumask_next_and(int n, const struct cpumask *src1p,
 
 #if NR_CPUS == 1
 static __always_inline
-unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap)
+unsigned int cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap)
 {
        cpumask_check(start);
        if (n != -1)
@@ -312,7 +312,7 @@ unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, boo
        return cpumask_first(mask);
 }
 #else
-unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap);
+unsigned int __pure cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap);
 #endif
 
 /**
index 418987056340ea430c8330397d606e881eddb3af..78e202fabf90ad579de1d7bf00e82f72b2ed634b 100644 (file)
@@ -290,7 +290,7 @@ static struct padata_priv *padata_find_next(struct parallel_data *pd,
        if (remove_object) {
                list_del_init(&padata->list);
                ++pd->processed;
-               pd->cpu = cpumask_next_wrap(cpu, pd->cpumask.pcpu, -1, false);
+               pd->cpu = cpumask_next_wrap_old(cpu, pd->cpumask.pcpu, -1, false);
        }
 
        spin_unlock(&reorder->lock);
index 57274ba8b6d991e22a13f2df63982ccda5cba5ac..5ed1dd7e6e33fab338b7881ff3740a570e43751d 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/numa.h>
 
 /**
- * cpumask_next_wrap - helper to implement for_each_cpu_wrap
+ * cpumask_next_wrap_old - helper to implement for_each_cpu_wrap
  * @n: the cpu prior to the place to search
  * @mask: the cpumask pointer
  * @start: the start point of the iteration
@@ -19,7 +19,7 @@
  * Note: the @wrap argument is required for the start condition when
  * we cannot assume @start is set in @mask.
  */
-unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap)
+unsigned int cpumask_next_wrap_old(int n, const struct cpumask *mask, int start, bool wrap)
 {
        unsigned int next;
 
@@ -37,7 +37,7 @@ again:
 
        return next;
 }
-EXPORT_SYMBOL(cpumask_next_wrap);
+EXPORT_SYMBOL(cpumask_next_wrap_old);
 
 /* These are not inline because of header tangles. */
 #ifdef CONFIG_CPUMASK_OFFSTACK