Commit dc5bb9b7 authored by Yury Norov's avatar Yury Norov
Browse files

cpumask: deprecate cpumask_next_wrap()



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: default avatarYury Norov <yury.norov@gmail.com>
parent 40ba13b4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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))
+1 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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 */
+2 −2
Original line number Diff line number Diff line
@@ -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

/**
+1 −1
Original line number Diff line number Diff line
@@ -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);
Loading