mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/apic: remove vector_lock from apic_retrigger_irq()
@ 2026-02-20 15:12 Luigi Rizzo
  2026-03-11 21:59 ` Luigi Rizzo
  2026-08-19 12:59 ` Luigi Rizzo
  0 siblings, 2 replies; 3+ messages in thread
From: Luigi Rizzo @ 2026-02-20 15:12 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier, Luigi Rizzo
  Cc: linux-kernel, linux-arch, Luigi Rizzo

apic_retrigger_irq() grabs vector_lock, but this is not needed because
any caller of this function holds the irqdesc lock, and that suffices to
protect apicd->vector.

Remove the unnecessary lock.

Thomas found this is a leftover from v2.6 when it was truly needed.

Signed-off-by: Luigi Rizzo <lrizzo@google.com>
---
 arch/x86/kernel/apic/vector.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index bddc544653999..fd0f133b379fd 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -1002,11 +1002,8 @@ static void apic_force_complete_move(struct irq_data *irqd)
 static int apic_retrigger_irq(struct irq_data *irqd)
 {
 	struct apic_chip_data *apicd = apic_chip_data(irqd);
-	unsigned long flags;
 
-	raw_spin_lock_irqsave(&vector_lock, flags);
 	__apic_send_IPI(apicd->cpu, apicd->vector);
-	raw_spin_unlock_irqrestore(&vector_lock, flags);
 
 	return 1;
 }
-- 
2.53.0.345.g96ddfc5eaa-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/apic: remove vector_lock from apic_retrigger_irq()
  2026-02-20 15:12 [PATCH] x86/apic: remove vector_lock from apic_retrigger_irq() Luigi Rizzo
@ 2026-03-11 21:59 ` Luigi Rizzo
  2026-08-19 12:59 ` Luigi Rizzo
  1 sibling, 0 replies; 3+ messages in thread
From: Luigi Rizzo @ 2026-03-11 21:59 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier, Luigi Rizzo; +Cc: linux-kernel, linux-arch

On Fri, Feb 20, 2026 at 4:12 PM Luigi Rizzo <lrizzo@google.com> wrote:
>
> apic_retrigger_irq() grabs vector_lock, but this is not needed because
> any caller of this function holds the irqdesc lock, and that suffices to
> protect apicd->vector.
>
> Remove the unnecessary lock.
>
> Thomas found this is a leftover from v2.6 when it was truly needed.
>
> Signed-off-by: Luigi Rizzo <lrizzo@google.com>
> ---
>  arch/x86/kernel/apic/vector.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
> index bddc544653999..fd0f133b379fd 100644
> --- a/arch/x86/kernel/apic/vector.c
> +++ b/arch/x86/kernel/apic/vector.c
> @@ -1002,11 +1002,8 @@ static void apic_force_complete_move(struct irq_data *irqd)
>  static int apic_retrigger_irq(struct irq_data *irqd)
>  {
>         struct apic_chip_data *apicd = apic_chip_data(irqd);
> -       unsigned long flags;
>
> -       raw_spin_lock_irqsave(&vector_lock, flags);
>         __apic_send_IPI(apicd->cpu, apicd->vector);
> -       raw_spin_unlock_irqrestore(&vector_lock, flags);
>
>         return 1;
>  }
> --
> 2.53.0.345.g96ddfc5eaa-goog
>

Is there any concern with this proposed patch?

cheers
luigi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/apic: remove vector_lock from apic_retrigger_irq()
  2026-02-20 15:12 [PATCH] x86/apic: remove vector_lock from apic_retrigger_irq() Luigi Rizzo
  2026-03-11 21:59 ` Luigi Rizzo
@ 2026-08-19 12:59 ` Luigi Rizzo
  1 sibling, 0 replies; 3+ messages in thread
From: Luigi Rizzo @ 2026-08-19 12:59 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier, Luigi Rizzo; +Cc: linux-kernel, linux-arch

On Fri, Feb 20, 2026 at 4:12 PM Luigi Rizzo <lrizzo@google.com> wrote:
>
> apic_retrigger_irq() grabs vector_lock, but this is not needed because
> any caller of this function holds the irqdesc lock, and that suffices to
> protect apicd->vector.
>
> Remove the unnecessary lock.
>
> Thomas found this is a leftover from v2.6 when it was truly needed.
>
> Signed-off-by: Luigi Rizzo <lrizzo@google.com>

Ping..
Is there any concern with this patch? We discussed it back in February,
see https://lore.kernel.org/all/87o6llwzd8.ffs@tglx/
and tgx confirmed the lock is not needed.

thanks
luigi

> ---
>  arch/x86/kernel/apic/vector.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
> index bddc544653999..fd0f133b379fd 100644
> --- a/arch/x86/kernel/apic/vector.c
> +++ b/arch/x86/kernel/apic/vector.c
> @@ -1002,11 +1002,8 @@ static void apic_force_complete_move(struct irq_data *irqd)
>  static int apic_retrigger_irq(struct irq_data *irqd)
>  {
>         struct apic_chip_data *apicd = apic_chip_data(irqd);
> -       unsigned long flags;
>
> -       raw_spin_lock_irqsave(&vector_lock, flags);
>         __apic_send_IPI(apicd->cpu, apicd->vector);
> -       raw_spin_unlock_irqrestore(&vector_lock, flags);
>
>         return 1;
>  }
> --
> 2.53.0.345.g96ddfc5eaa-goog
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-19 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-20 15:12 [PATCH] x86/apic: remove vector_lock from apic_retrigger_irq() Luigi Rizzo
2026-03-11 21:59 ` Luigi Rizzo
2026-08-19 12:59 ` Luigi Rizzo

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®