* [PATCH] genirq: use cpumask_intersects
@ 2024-09-04 13:48 Costa Shulyupin
2024-09-06 1:36 ` Ming Lei
2024-09-06 14:31 ` [tip: irq/core] genirq/cpuhotplug: Use cpumask_intersects() tip-bot2 for Costa Shulyupin
0 siblings, 2 replies; 3+ messages in thread
From: Costa Shulyupin @ 2024-09-04 13:48 UTC (permalink / raw)
To: Thomas Gleixner, linux-kernel; +Cc: ming.lei, Costa Shulyupin
Replace `cpumask_any_and(a, b) >= nr_cpu_ids`
with more readable `!cpumask_intersects(a, b)`.
Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
---
kernel/irq/cpuhotplug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index eb86283901565..15a7654eff684 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -37,7 +37,7 @@ static inline bool irq_needs_fixup(struct irq_data *d)
* has been removed from the online mask already.
*/
if (cpumask_any_but(m, cpu) < nr_cpu_ids &&
- cpumask_any_and(m, cpu_online_mask) >= nr_cpu_ids) {
+ !cpumask_intersects(m, cpu_online_mask)) {
/*
* If this happens then there was a missed IRQ fixup at some
* point. Warn about it and enforce fixup.
@@ -110,7 +110,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
if (maskchip && chip->irq_mask)
chip->irq_mask(d);
- if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
+ if (!cpumask_intersects(affinity, cpu_online_mask)) {
/*
* If the interrupt is managed, then shut it down and leave
* the affinity untouched.
--
2.45.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] genirq: use cpumask_intersects
2024-09-04 13:48 [PATCH] genirq: use cpumask_intersects Costa Shulyupin
@ 2024-09-06 1:36 ` Ming Lei
2024-09-06 14:31 ` [tip: irq/core] genirq/cpuhotplug: Use cpumask_intersects() tip-bot2 for Costa Shulyupin
1 sibling, 0 replies; 3+ messages in thread
From: Ming Lei @ 2024-09-06 1:36 UTC (permalink / raw)
To: Costa Shulyupin; +Cc: Thomas Gleixner, linux-kernel
On Wed, Sep 4, 2024 at 9:49 PM Costa Shulyupin <costa.shul@redhat.com> wrote:
>
> Replace `cpumask_any_and(a, b) >= nr_cpu_ids`
> with more readable `!cpumask_intersects(a, b)`.
>
> Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
> ---
> kernel/irq/cpuhotplug.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
> index eb86283901565..15a7654eff684 100644
> --- a/kernel/irq/cpuhotplug.c
> +++ b/kernel/irq/cpuhotplug.c
> @@ -37,7 +37,7 @@ static inline bool irq_needs_fixup(struct irq_data *d)
> * has been removed from the online mask already.
> */
> if (cpumask_any_but(m, cpu) < nr_cpu_ids &&
> - cpumask_any_and(m, cpu_online_mask) >= nr_cpu_ids) {
> + !cpumask_intersects(m, cpu_online_mask)) {
> /*
> * If this happens then there was a missed IRQ fixup at some
> * point. Warn about it and enforce fixup.
> @@ -110,7 +110,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
> if (maskchip && chip->irq_mask)
> chip->irq_mask(d);
>
> - if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
> + if (!cpumask_intersects(affinity, cpu_online_mask)) {
> /*
> * If the interrupt is managed, then shut it down and leave
> * the affinity untouched.
Looks fine,
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip: irq/core] genirq/cpuhotplug: Use cpumask_intersects()
2024-09-04 13:48 [PATCH] genirq: use cpumask_intersects Costa Shulyupin
2024-09-06 1:36 ` Ming Lei
@ 2024-09-06 14:31 ` tip-bot2 for Costa Shulyupin
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Costa Shulyupin @ 2024-09-06 14:31 UTC (permalink / raw)
To: linux-tip-commits
Cc: Costa Shulyupin, Thomas Gleixner, Ming Lei, x86, linux-kernel, maz
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 87b5a153b862b7d937fc1dd499368297a1feae87
Gitweb: https://git.kernel.org/tip/87b5a153b862b7d937fc1dd499368297a1feae87
Author: Costa Shulyupin <costa.shul@redhat.com>
AuthorDate: Wed, 04 Sep 2024 16:48:23 +03:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 06 Sep 2024 16:28:39 +02:00
genirq/cpuhotplug: Use cpumask_intersects()
Replace `cpumask_any_and(a, b) >= nr_cpu_ids`
with the more readable `!cpumask_intersects(a, b)`.
[ tglx: Massaged change log ]
Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/all/20240904134823.777623-2-costa.shul@redhat.com
---
kernel/irq/cpuhotplug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index eb86283..15a7654 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -37,7 +37,7 @@ static inline bool irq_needs_fixup(struct irq_data *d)
* has been removed from the online mask already.
*/
if (cpumask_any_but(m, cpu) < nr_cpu_ids &&
- cpumask_any_and(m, cpu_online_mask) >= nr_cpu_ids) {
+ !cpumask_intersects(m, cpu_online_mask)) {
/*
* If this happens then there was a missed IRQ fixup at some
* point. Warn about it and enforce fixup.
@@ -110,7 +110,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
if (maskchip && chip->irq_mask)
chip->irq_mask(d);
- if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
+ if (!cpumask_intersects(affinity, cpu_online_mask)) {
/*
* If the interrupt is managed, then shut it down and leave
* the affinity untouched.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-06 14:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-04 13:48 [PATCH] genirq: use cpumask_intersects Costa Shulyupin
2024-09-06 1:36 ` Ming Lei
2024-09-06 14:31 ` [tip: irq/core] genirq/cpuhotplug: Use cpumask_intersects() tip-bot2 for Costa Shulyupin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®