* [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage
@ 2024-12-28 18:49 Yury Norov
2024-12-28 18:49 ` [PATCH 02/14] virtio_net: simplify virtnet_set_affinity() Yury Norov
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Yury Norov @ 2024-12-28 18:49 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Haren Myneni, Rick Lindsley, Nick Child, Thomas Falcon,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
Dexuan Cui, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Yury Norov, Rasmus Villemoes, Matt Wu, Steffen Klassert,
Daniel Jordan, Andrew Morton, Greg Kurz, Peter Xu,
Shrikanth Hegde, Hendrik Brueckner
cpumask_next_wrap() is overly complicated, comparing to it's generic
version find_next_bit_wrap(), not mentioning it duplicates the above.
It roots to the times when the function was used in the implementation
of for_each_cpu_wrap() iterator. The function has 2 additional parameters
that were used to catch loop termination condition for the iterator.
(Although, only one is needed.)
Since 4fe49b3b97c262 ("lib/bitmap: introduce for_each_set_bit_wrap()
macro"), for_each_cpu_wrap() is wired to corresponding generic
wrapping bitmap iterator, and additional complexity of
cpumask_next_wrap() is not needed anymore.
All existing users call cpumask_next_wrap() in a manner that makes
it possible to turn it to a straight and simple alias to
find_next_bit_wrap().
This series replaces historical 4-parameter cpumask_next_wrap() with a
thin 2-parameter wrapper around find_next_bit_wrap().
Where it's possible to use for_each_cpu_wrap() iterator, the code is
switched to use it because it's always preferable to use iterators over
open loops.
This series touches various scattered subsystems and To-list for the
whole series is quite a long. To minimize noise, I send cover-letter and
key patches #5 and 6 to every person involved. All other patches are sent
individually to those pointed by scripts/get_maintainers.pl.
I'd like to move the series with my bitmap-for-next branch as a whole.
Yury Norov (14):
objpool: rework objpool_pop()
virtio_net: simplify virtnet_set_affinity()
ibmvnic: simplify ibmvnic_set_queue_affinity()
powerpc/xmon: simplify xmon_batch_next_cpu()
cpumask: deprecate cpumask_next_wrap()
cpumask: re-introduce cpumask_next_wrap()
cpumask: use cpumask_next_wrap() where appropriate
padata: switch padata_find_next() to using cpumask_next_wrap()
s390: switch stop_machine_yield() to using cpumask_next_wrap()
nvme-tcp: switch nvme_tcp_set_queue_io_cpu() to using
cpumask_next_wrap()
scsi: lpfc: switch lpfc_irq_rebalance() to using cpumask_next_wrap()
scsi: lpfc: rework lpfc_next_{online,present}_cpu()
PCI: hv: switch hv_compose_multi_msi_req_get_cpu() to using
cpumask_next_wrap()
cpumask: drop cpumask_next_wrap_old()
arch/powerpc/xmon/xmon.c | 6 +---
arch/s390/kernel/processor.c | 2 +-
drivers/net/ethernet/ibm/ibmvnic.c | 17 +++++-----
drivers/net/virtio_net.c | 12 +++++---
drivers/nvme/host/tcp.c | 2 +-
drivers/pci/controller/pci-hyperv.c | 3 +-
drivers/scsi/lpfc/lpfc.h | 23 +++-----------
drivers/scsi/lpfc/lpfc_init.c | 2 +-
include/linux/cpumask.h | 48 ++++++++++++++++-------------
include/linux/objpool.h | 7 ++---
kernel/padata.c | 2 +-
lib/cpumask.c | 37 ++--------------------
12 files changed, 60 insertions(+), 101 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 02/14] virtio_net: simplify virtnet_set_affinity()
2024-12-28 18:49 [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Yury Norov
@ 2024-12-28 18:49 ` Yury Norov
2024-12-28 18:49 ` [PATCH 05/14] cpumask: deprecate cpumask_next_wrap() Yury Norov
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Yury Norov @ 2024-12-28 18:49 UTC (permalink / raw)
To: linux-kernel, netdev, virtualization, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Yury Norov, Rasmus Villemoes
The inner loop may be replaced with the dedicated for_each_online_cpu_wrap.
It helps to avoid setting the same bits in the @mask more than once, in
case of group_size is greater than number of online CPUs.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
drivers/net/virtio_net.c | 12 +++++++-----
include/linux/cpumask.h | 4 ++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 7646ddd9bef7..5e266486de1f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -3826,7 +3826,7 @@ static void virtnet_set_affinity(struct virtnet_info *vi)
cpumask_var_t mask;
int stragglers;
int group_size;
- int i, j, cpu;
+ int i, start = 0, cpu;
int num_cpu;
int stride;
@@ -3840,16 +3840,18 @@ static void virtnet_set_affinity(struct virtnet_info *vi)
stragglers = num_cpu >= vi->curr_queue_pairs ?
num_cpu % vi->curr_queue_pairs :
0;
- cpu = cpumask_first(cpu_online_mask);
for (i = 0; i < vi->curr_queue_pairs; i++) {
group_size = stride + (i < stragglers ? 1 : 0);
- for (j = 0; j < group_size; j++) {
+ for_each_online_cpu_wrap(cpu, start) {
+ if (!group_size--)
+ break;
cpumask_set_cpu(cpu, mask);
- cpu = cpumask_next_wrap(cpu, cpu_online_mask,
- nr_cpu_ids, false);
}
+
+ start = cpu < nr_cpu_ids ? cpu + 1 : start;
+
virtqueue_set_affinity(vi->rq[i].vq, mask);
virtqueue_set_affinity(vi->sq[i].vq, mask);
__netif_set_xps_queue(vi->dev, cpumask_bits(mask), i, XPS_CPUS);
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 5cf69a110c1c..30042351f15f 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -1036,6 +1036,8 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);
#define for_each_possible_cpu_wrap(cpu, start) \
for ((void)(start), (cpu) = 0; (cpu) < 1; (cpu)++)
+#define for_each_online_cpu_wrap(cpu, start) \
+ for ((void)(start), (cpu) = 0; (cpu) < 1; (cpu)++)
#else
#define for_each_possible_cpu(cpu) for_each_cpu((cpu), cpu_possible_mask)
#define for_each_online_cpu(cpu) for_each_cpu((cpu), cpu_online_mask)
@@ -1044,6 +1046,8 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS);
#define for_each_possible_cpu_wrap(cpu, start) \
for_each_cpu_wrap((cpu), cpu_possible_mask, (start))
+#define for_each_online_cpu_wrap(cpu, start) \
+ for_each_cpu_wrap((cpu), cpu_online_mask, (start))
#endif
/* Wrappers for arch boot code to manipulate normally-constant masks */
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 05/14] cpumask: deprecate cpumask_next_wrap()
2024-12-28 18:49 [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Yury Norov
2024-12-28 18:49 ` [PATCH 02/14] virtio_net: simplify virtnet_set_affinity() Yury Norov
@ 2024-12-28 18:49 ` Yury Norov
2025-01-03 17:39 ` Bjorn Helgaas
2024-12-28 18:49 ` [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap() Yury Norov
2025-01-03 7:02 ` [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Christoph Hellwig
3 siblings, 1 reply; 11+ messages in thread
From: Yury Norov @ 2024-12-28 18:49 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Haren Myneni, Rick Lindsley, Nick Child, Thomas Falcon,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
Dexuan Cui, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Yury Norov, Rasmus Villemoes, Matt Wu, Steffen Klassert,
Daniel Jordan, Andrew Morton, Greg Kurz, Peter Xu,
Shrikanth Hegde, Hendrik Brueckner
The next patche aligns implementation of cpumask_next_wrap() with the
generic version in find.h which 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 | 2 +-
drivers/nvme/host/tcp.c | 2 +-
drivers/pci/controller/pci-hyperv.c | 2 +-
drivers/scsi/lpfc/lpfc_init.c | 2 +-
include/linux/cpumask.h | 4 ++--
kernel/padata.c | 2 +-
lib/cpumask.c | 6 +++---
7 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c
index 5ce9a795a0fe..42ca61909030 100644
--- a/arch/s390/kernel/processor.c
+++ b/arch/s390/kernel/processor.c
@@ -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))
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 28c76a3e1bd2..054904376c3c 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1578,7 +1578,7 @@ static void nvme_tcp_set_queue_io_cpu(struct nvme_tcp_queue *queue)
if (wq_unbound)
queue->io_cpu = WORK_CPU_UNBOUND;
else
- queue->io_cpu = cpumask_next_wrap(n - 1, cpu_online_mask, -1, false);
+ queue->io_cpu = cpumask_next_wrap_old(n - 1, cpu_online_mask, -1, false);
}
static void nvme_tcp_tls_done(void *data, int status, key_serial_t pskid)
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index cdd5be16021d..86d1c2be8eb5 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -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;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 7f57397d91a9..31622fb0614a 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -12876,7 +12876,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 */
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 30042351f15f..b267a4f6a917 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -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
/**
diff --git a/kernel/padata.c b/kernel/padata.c
index d51bbc76b227..454ff2fca40b 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -274,7 +274,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);
diff --git a/lib/cpumask.c b/lib/cpumask.c
index e77ee9d46f71..c9a9b451772a 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -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 @@ unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, boo
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
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap()
2024-12-28 18:49 [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Yury Norov
2024-12-28 18:49 ` [PATCH 02/14] virtio_net: simplify virtnet_set_affinity() Yury Norov
2024-12-28 18:49 ` [PATCH 05/14] cpumask: deprecate cpumask_next_wrap() Yury Norov
@ 2024-12-28 18:49 ` Yury Norov
2025-01-03 17:44 ` Bjorn Helgaas
2025-01-07 13:28 ` Alexander Gordeev
2025-01-03 7:02 ` [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Christoph Hellwig
3 siblings, 2 replies; 11+ messages in thread
From: Yury Norov @ 2024-12-28 18:49 UTC (permalink / raw)
To: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Haren Myneni, Rick Lindsley, Nick Child, Thomas Falcon,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
Dexuan Cui, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Yury Norov, Rasmus Villemoes, Matt Wu, Steffen Klassert,
Daniel Jordan, Andrew Morton, Greg Kurz, Peter Xu,
Shrikanth Hegde, Hendrik Brueckner
cpumask_next_wrap_old() has two additional parameters, comparing to it's
analogue in linux/find.h find_next_bit_wrap(). The reason for that is
historical.
Before 4fe49b3b97c262 ("lib/bitmap: introduce for_each_set_bit_wrap()
macro"), cpumask_next_wrap() was used to implement for_each_cpu_wrap()
iterator. Now that the iterator is an alias to generic
for_each_set_bit_wrap(), the additional parameters aren't used and may
confuse readers.
All existing users call cpumask_next_wrap() in a way that makes it
possible to turn it to straight and simple alias to find_next_bit_wrap().
In a couple places kernel users opencode missing cpumask_next_and_wrap().
Add it as well.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
include/linux/cpumask.h | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index b267a4f6a917..18c9908d50c4 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -284,6 +284,43 @@ unsigned int cpumask_next_and(int n, const struct cpumask *src1p,
small_cpumask_bits, n + 1);
}
+/**
+ * cpumask_next_and_wrap - get the next cpu in *src1p & *src2p, starting from
+ * @n and wrapping around, if needed
+ * @n: the cpu prior to the place to search (i.e. return will be > @n)
+ * @src1p: the first cpumask pointer
+ * @src2p: the second cpumask pointer
+ *
+ * Return: >= nr_cpu_ids if no further cpus set in both.
+ */
+static __always_inline
+unsigned int cpumask_next_and_wrap(int n, const struct cpumask *src1p,
+ const struct cpumask *src2p)
+{
+ /* -1 is a legal arg here. */
+ if (n != -1)
+ cpumask_check(n);
+ return find_next_and_bit_wrap(cpumask_bits(src1p), cpumask_bits(src2p),
+ small_cpumask_bits, n + 1);
+}
+
+/*
+ * cpumask_next_wrap - get the next cpu in *src, starting from
+ * @n and wrapping around, if needed
+ * @n: the cpu prior to the place to search
+ * @src: cpumask pointer
+ *
+ * Return: >= nr_cpu_ids if no further cpus set in both.
+ */
+static __always_inline
+unsigned int cpumask_next_wrap(int n, const struct cpumask *src)
+{
+ /* -1 is a legal arg here. */
+ if (n != -1)
+ cpumask_check(n);
+ return find_next_bit_wrap(cpumask_bits(src), small_cpumask_bits, n + 1);
+}
+
/**
* for_each_cpu - iterate over every cpu in a mask
* @cpu: the (optionally unsigned) integer iterator
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage
2024-12-28 18:49 [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Yury Norov
` (2 preceding siblings ...)
2024-12-28 18:49 ` [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap() Yury Norov
@ 2025-01-03 7:02 ` Christoph Hellwig
2025-01-03 15:21 ` Yury Norov
3 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2025-01-03 7:02 UTC (permalink / raw)
To: Yury Norov
Cc: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Haren Myneni, Rick Lindsley, Nick Child, Thomas Falcon,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
Dexuan Cui, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Rasmus Villemoes, Matt Wu, Steffen Klassert, Daniel Jordan,
Andrew Morton, Greg Kurz, Peter Xu, Shrikanth Hegde,
Hendrik Brueckner
You've sent me less than a handfull of 14 patches, there's no way
to properly review this.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage
2025-01-03 7:02 ` [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Christoph Hellwig
@ 2025-01-03 15:21 ` Yury Norov
0 siblings, 0 replies; 11+ messages in thread
From: Yury Norov @ 2025-01-03 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Haren Myneni, Rick Lindsley, Nick Child, Thomas Falcon,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Keith Busch, Jens Axboe, Sagi Grimberg,
K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Rasmus Villemoes, Matt Wu, Steffen Klassert, Daniel Jordan,
Andrew Morton, Greg Kurz, Peter Xu, Shrikanth Hegde,
Hendrik Brueckner
On Fri, Jan 03, 2025 at 08:02:29AM +0100, Christoph Hellwig wrote:
> You've sent me less than a handfull of 14 patches, there's no way
> to properly review this.
Hi Christoph,
You can find the whole series here:
https://lore.kernel.org/linux-scsi/CABPRKS-uqfJmDp5pS+hSnvzggdMv0bNawpsVNpY4aU4V+UdR7Q@mail.gmail.com/T/
Or you can download it by message ID like this:
b4 mbox 20241228184949.31582-1-yury.norov@gmail.com
Sorry for not CC-ing you to the whole series. Some people prefer to
receive minimal noise, and you never know who is who. If it comes to
v2, you'll be in CC for every patch.
Thanks,
Yury
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 05/14] cpumask: deprecate cpumask_next_wrap()
2024-12-28 18:49 ` [PATCH 05/14] cpumask: deprecate cpumask_next_wrap() Yury Norov
@ 2025-01-03 17:39 ` Bjorn Helgaas
0 siblings, 0 replies; 11+ messages in thread
From: Bjorn Helgaas @ 2025-01-03 17:39 UTC (permalink / raw)
To: Yury Norov
Cc: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Haren Myneni, Rick Lindsley, Nick Child, Thomas Falcon,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
Dexuan Cui, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Rasmus Villemoes, Matt Wu, Steffen Klassert, Daniel Jordan,
Andrew Morton, Greg Kurz, Peter Xu, Shrikanth Hegde,
Hendrik Brueckner
On Sat, Dec 28, 2024 at 10:49:37AM -0800, Yury Norov wrote:
> The next patche aligns implementation of cpumask_next_wrap() with the
> generic version in find.h which changes function signature.
s/patche/patch/
I guess this is an indirect reference to find_next_bit_wrap()? If so,
I think mentioning the function name would be more useful than
referring to "the generic version in find.h".
> 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 | 2 +-
> drivers/nvme/host/tcp.c | 2 +-
> drivers/pci/controller/pci-hyperv.c | 2 +-
> drivers/scsi/lpfc/lpfc_init.c | 2 +-
> include/linux/cpumask.h | 4 ++--
> kernel/padata.c | 2 +-
> lib/cpumask.c | 6 +++---
> 7 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c
> index 5ce9a795a0fe..42ca61909030 100644
> --- a/arch/s390/kernel/processor.c
> +++ b/arch/s390/kernel/processor.c
> @@ -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))
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index 28c76a3e1bd2..054904376c3c 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -1578,7 +1578,7 @@ static void nvme_tcp_set_queue_io_cpu(struct nvme_tcp_queue *queue)
> if (wq_unbound)
> queue->io_cpu = WORK_CPU_UNBOUND;
> else
> - queue->io_cpu = cpumask_next_wrap(n - 1, cpu_online_mask, -1, false);
> + queue->io_cpu = cpumask_next_wrap_old(n - 1, cpu_online_mask, -1, false);
> }
>
> static void nvme_tcp_tls_done(void *data, int status, key_serial_t pskid)
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index cdd5be16021d..86d1c2be8eb5 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -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;
>
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 7f57397d91a9..31622fb0614a 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -12876,7 +12876,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 */
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index 30042351f15f..b267a4f6a917 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -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
>
> /**
> diff --git a/kernel/padata.c b/kernel/padata.c
> index d51bbc76b227..454ff2fca40b 100644
> --- a/kernel/padata.c
> +++ b/kernel/padata.c
> @@ -274,7 +274,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);
> diff --git a/lib/cpumask.c b/lib/cpumask.c
> index e77ee9d46f71..c9a9b451772a 100644
> --- a/lib/cpumask.c
> +++ b/lib/cpumask.c
> @@ -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 @@ unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, boo
>
> 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
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap()
2024-12-28 18:49 ` [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap() Yury Norov
@ 2025-01-03 17:44 ` Bjorn Helgaas
2025-01-15 3:41 ` Yury Norov
2025-01-07 13:28 ` Alexander Gordeev
1 sibling, 1 reply; 11+ messages in thread
From: Bjorn Helgaas @ 2025-01-03 17:44 UTC (permalink / raw)
To: Yury Norov
Cc: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Haren Myneni, Rick Lindsley, Nick Child, Thomas Falcon,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
Dexuan Cui, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Rasmus Villemoes, Matt Wu, Steffen Klassert, Daniel Jordan,
Andrew Morton, Greg Kurz, Peter Xu, Shrikanth Hegde,
Hendrik Brueckner
On Sat, Dec 28, 2024 at 10:49:38AM -0800, Yury Norov wrote:
> cpumask_next_wrap_old() has two additional parameters, comparing to it's
> analogue in linux/find.h find_next_bit_wrap(). The reason for that is
> historical.
s/it's/its/
Personally I think cscope/tags/git grep make "find_next_bit_wrap()"
enough even without mentioning "linux/find.h".
> + * cpumask_next_and_wrap - get the next cpu in *src1p & *src2p, starting from
> + * @n and wrapping around, if needed
> + * @n: the cpu prior to the place to search (i.e. return will be > @n)
Is the return really > @n if it wraps?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap()
2024-12-28 18:49 ` [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap() Yury Norov
2025-01-03 17:44 ` Bjorn Helgaas
@ 2025-01-07 13:28 ` Alexander Gordeev
2025-01-15 3:38 ` Yury Norov
1 sibling, 1 reply; 11+ messages in thread
From: Alexander Gordeev @ 2025-01-07 13:28 UTC (permalink / raw)
To: Yury Norov
Cc: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Christian Borntraeger, Sven Schnelle, Haren Myneni, Rick Lindsley,
Nick Child, Thomas Falcon, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Keith Busch,
Jens Axboe, Christoph Hellwig, Sagi Grimberg, K. Y. Srinivasan,
Haiyang Zhang, Wei Liu, Dexuan Cui, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Bjorn Helgaas, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Rasmus Villemoes, Matt Wu, Steffen Klassert,
Daniel Jordan, Andrew Morton, Greg Kurz, Peter Xu,
Shrikanth Hegde, Hendrik Brueckner
On Sat, Dec 28, 2024 at 10:49:38AM -0800, Yury Norov wrote:
Hi Yury,
> cpumask_next_wrap_old() has two additional parameters, comparing to it's
> analogue in linux/find.h find_next_bit_wrap(). The reason for that is
> historical.
>
> Before 4fe49b3b97c262 ("lib/bitmap: introduce for_each_set_bit_wrap()
> macro"), cpumask_next_wrap() was used to implement for_each_cpu_wrap()
> iterator. Now that the iterator is an alias to generic
> for_each_set_bit_wrap(), the additional parameters aren't used and may
> confuse readers.
>
> All existing users call cpumask_next_wrap() in a way that makes it
> possible to turn it to straight and simple alias to find_next_bit_wrap().
>
> In a couple places kernel users opencode missing cpumask_next_and_wrap().
> Add it as well.
>
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
> ---
> include/linux/cpumask.h | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index b267a4f6a917..18c9908d50c4 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -284,6 +284,43 @@ unsigned int cpumask_next_and(int n, const struct cpumask *src1p,
> small_cpumask_bits, n + 1);
> }
>
> +/**
> + * cpumask_next_and_wrap - get the next cpu in *src1p & *src2p, starting from
> + * @n and wrapping around, if needed
> + * @n: the cpu prior to the place to search (i.e. return will be > @n)
> + * @src1p: the first cpumask pointer
> + * @src2p: the second cpumask pointer
> + *
> + * Return: >= nr_cpu_ids if no further cpus set in both.
> + */
> +static __always_inline
> +unsigned int cpumask_next_and_wrap(int n, const struct cpumask *src1p,
> + const struct cpumask *src2p)
> +{
> + /* -1 is a legal arg here. */
> + if (n != -1)
> + cpumask_check(n);
> + return find_next_and_bit_wrap(cpumask_bits(src1p), cpumask_bits(src2p),
> + small_cpumask_bits, n + 1);
> +}
> +
> +/*
> + * cpumask_next_wrap - get the next cpu in *src, starting from
> + * @n and wrapping around, if needed
Does it mean the search wraps a cpumask and starts from the beginning
if the bit is not found and returns >= nr_cpu_ids if @n crosses itself?
> + * @n: the cpu prior to the place to search
> + * @src: cpumask pointer
> + *
> + * Return: >= nr_cpu_ids if no further cpus set in both.
It looks like Return is a cpumask_next_and_wrap() comment leftover.
> + */
> +static __always_inline
> +unsigned int cpumask_next_wrap(int n, const struct cpumask *src)
> +{
> + /* -1 is a legal arg here. */
> + if (n != -1)
> + cpumask_check(n);
> + return find_next_bit_wrap(cpumask_bits(src), small_cpumask_bits, n + 1);
> +}
> +
> /**
> * for_each_cpu - iterate over every cpu in a mask
> * @cpu: the (optionally unsigned) integer iterator
Thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap()
2025-01-07 13:28 ` Alexander Gordeev
@ 2025-01-15 3:38 ` Yury Norov
0 siblings, 0 replies; 11+ messages in thread
From: Yury Norov @ 2025-01-15 3:38 UTC (permalink / raw)
To: Alexander Gordeev
Cc: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Christian Borntraeger, Sven Schnelle, Haren Myneni, Rick Lindsley,
Nick Child, Thomas Falcon, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Michael S. Tsirkin,
Jason Wang, Xuan Zhuo, Eugenio Pérez, Keith Busch,
Jens Axboe, Christoph Hellwig, Sagi Grimberg, K. Y. Srinivasan,
Haiyang Zhang, Wei Liu, Dexuan Cui, Lorenzo Pieralisi,
Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
Bjorn Helgaas, James Smart, Dick Kennedy, James E.J. Bottomley,
Martin K. Petersen, Rasmus Villemoes, Matt Wu, Steffen Klassert,
Daniel Jordan, Andrew Morton, Greg Kurz, Peter Xu,
Shrikanth Hegde, Hendrik Brueckner
On Tue, Jan 07, 2025 at 02:28:31PM +0100, Alexander Gordeev wrote:
> On Sat, Dec 28, 2024 at 10:49:38AM -0800, Yury Norov wrote:
>
> Hi Yury,
>
> > cpumask_next_wrap_old() has two additional parameters, comparing to it's
> > analogue in linux/find.h find_next_bit_wrap(). The reason for that is
> > historical.
> >
> > Before 4fe49b3b97c262 ("lib/bitmap: introduce for_each_set_bit_wrap()
> > macro"), cpumask_next_wrap() was used to implement for_each_cpu_wrap()
> > iterator. Now that the iterator is an alias to generic
> > for_each_set_bit_wrap(), the additional parameters aren't used and may
> > confuse readers.
> >
> > All existing users call cpumask_next_wrap() in a way that makes it
> > possible to turn it to straight and simple alias to find_next_bit_wrap().
> >
> > In a couple places kernel users opencode missing cpumask_next_and_wrap().
> > Add it as well.
> >
> > Signed-off-by: Yury Norov <yury.norov@gmail.com>
> > ---
> > include/linux/cpumask.h | 37 +++++++++++++++++++++++++++++++++++++
> > 1 file changed, 37 insertions(+)
> >
> > diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> > index b267a4f6a917..18c9908d50c4 100644
> > --- a/include/linux/cpumask.h
> > +++ b/include/linux/cpumask.h
> > @@ -284,6 +284,43 @@ unsigned int cpumask_next_and(int n, const struct cpumask *src1p,
> > small_cpumask_bits, n + 1);
> > }
> >
> > +/**
> > + * cpumask_next_and_wrap - get the next cpu in *src1p & *src2p, starting from
> > + * @n and wrapping around, if needed
> > + * @n: the cpu prior to the place to search (i.e. return will be > @n)
> > + * @src1p: the first cpumask pointer
> > + * @src2p: the second cpumask pointer
> > + *
> > + * Return: >= nr_cpu_ids if no further cpus set in both.
> > + */
> > +static __always_inline
> > +unsigned int cpumask_next_and_wrap(int n, const struct cpumask *src1p,
> > + const struct cpumask *src2p)
> > +{
> > + /* -1 is a legal arg here. */
> > + if (n != -1)
> > + cpumask_check(n);
> > + return find_next_and_bit_wrap(cpumask_bits(src1p), cpumask_bits(src2p),
> > + small_cpumask_bits, n + 1);
> > +}
> > +
> > +/*
> > + * cpumask_next_wrap - get the next cpu in *src, starting from
> > + * @n and wrapping around, if needed
>
> Does it mean the search wraps a cpumask and starts from the beginning
> if the bit is not found and returns >= nr_cpu_ids if @n crosses itself?
>
> > + * @n: the cpu prior to the place to search
> > + * @src: cpumask pointer
> > + *
> > + * Return: >= nr_cpu_ids if no further cpus set in both.
>
> It looks like Return is a cpumask_next_and_wrap() comment leftover.
>
> > + */
> > +static __always_inline
> > +unsigned int cpumask_next_wrap(int n, const struct cpumask *src)
> > +{
> > + /* -1 is a legal arg here. */
> > + if (n != -1)
> > + cpumask_check(n);
> > + return find_next_bit_wrap(cpumask_bits(src), small_cpumask_bits, n + 1);
> > +}
> > +
> > /**
> > * for_each_cpu - iterate over every cpu in a mask
> > * @cpu: the (optionally unsigned) integer iterator
>
> Thanks!
Thanks, I'll update the comments.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap()
2025-01-03 17:44 ` Bjorn Helgaas
@ 2025-01-15 3:41 ` Yury Norov
0 siblings, 0 replies; 11+ messages in thread
From: Yury Norov @ 2025-01-15 3:41 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-kernel, linuxppc-dev, linux-s390, netdev, virtualization,
linux-nvme, linux-hyperv, linux-pci, linux-scsi, linux-crypto,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
Haren Myneni, Rick Lindsley, Nick Child, Thomas Falcon,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Keith Busch, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
Dexuan Cui, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, James Smart,
Dick Kennedy, James E.J. Bottomley, Martin K. Petersen,
Rasmus Villemoes, Matt Wu, Steffen Klassert, Daniel Jordan,
Andrew Morton, Greg Kurz, Peter Xu, Shrikanth Hegde,
Hendrik Brueckner
On Fri, Jan 03, 2025 at 11:44:32AM -0600, Bjorn Helgaas wrote:
> On Sat, Dec 28, 2024 at 10:49:38AM -0800, Yury Norov wrote:
> > cpumask_next_wrap_old() has two additional parameters, comparing to it's
> > analogue in linux/find.h find_next_bit_wrap(). The reason for that is
> > historical.
>
> s/it's/its/
>
> Personally I think cscope/tags/git grep make "find_next_bit_wrap()"
> enough even without mentioning "linux/find.h".
>
> > + * cpumask_next_and_wrap - get the next cpu in *src1p & *src2p, starting from
> > + * @n and wrapping around, if needed
> > + * @n: the cpu prior to the place to search (i.e. return will be > @n)
>
> Is the return really > @n if it wraps?
No, this is a copy-paste error. Will fix in v2.
Thanks,
Yury
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-01-15 3:41 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-28 18:49 [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Yury Norov
2024-12-28 18:49 ` [PATCH 02/14] virtio_net: simplify virtnet_set_affinity() Yury Norov
2024-12-28 18:49 ` [PATCH 05/14] cpumask: deprecate cpumask_next_wrap() Yury Norov
2025-01-03 17:39 ` Bjorn Helgaas
2024-12-28 18:49 ` [PATCH 06/14] cpumask: re-introduce cpumask_next{,_and}_wrap() Yury Norov
2025-01-03 17:44 ` Bjorn Helgaas
2025-01-15 3:41 ` Yury Norov
2025-01-07 13:28 ` Alexander Gordeev
2025-01-15 3:38 ` Yury Norov
2025-01-03 7:02 ` [PATCH 00/14] cpumask: cleanup cpumask_next_wrap() implementation and usage Christoph Hellwig
2025-01-03 15:21 ` Yury Norov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).