[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <036f8679-485a-4c99-92e7-f271a972fbf8@intel.com>
Date: Wed, 21 May 2025 08:28:23 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Rik van Riel <riel@...riel.com>, linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, x86@...nel.org, kernel-team@...a.com,
dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
nadav.amit@...il.com, Rik van Riel <riel@...com>,
Yu-cheng Yu <yu-cheng.yu@...el.com>
Subject: Re: [RFC v2 6/9] x86/apic: Introduce Remote Action Request Operations
> diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
> index 0c1c68039d6f..1ab9f5fcac8a 100644
> --- a/arch/x86/include/asm/smp.h
> +++ b/arch/x86/include/asm/smp.h
> @@ -40,6 +40,9 @@ struct smp_ops {
>
> void (*send_call_func_ipi)(const struct cpumask *mask);
> void (*send_call_func_single_ipi)(int cpu);
> +
> + void (*send_rar_ipi)(const struct cpumask *mask);
> + void (*send_rar_single_ipi)(int cpu);
> };
I assume Yu-cheng did it this way.
I'm curios why new smp_ops are needed for this, though. It's not like
there are a bunch of different implementations to pick between.
> -void native_send_call_func_ipi(const struct cpumask *mask)
> +static void do_native_send_ipi(const struct cpumask *mask, int vector)
> {
> if (static_branch_likely(&apic_use_ipi_shorthand)) {
> unsigned int cpu = smp_processor_id();
> @@ -88,14 +88,19 @@ void native_send_call_func_ipi(const struct cpumask *mask)
> goto sendmask;
>
> if (cpumask_test_cpu(cpu, mask))
> - __apic_send_IPI_all(CALL_FUNCTION_VECTOR);
> + __apic_send_IPI_all(vector);
> else if (num_online_cpus() > 1)
> - __apic_send_IPI_allbutself(CALL_FUNCTION_VECTOR);
> + __apic_send_IPI_allbutself(vector);
> return;
> }
>
> sendmask:
> - __apic_send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
> + __apic_send_IPI_mask(mask, vector);
> +}
> +
> +void native_send_call_func_ipi(const struct cpumask *mask)
> +{
> + do_native_send_ipi(mask, CALL_FUNCTION_VECTOR);
> }
This refactoring probably belongs in a separate patch.
> void apic_send_nmi_to_offline_cpu(unsigned int cpu)
> @@ -106,6 +111,16 @@ void apic_send_nmi_to_offline_cpu(unsigned int cpu)
> return;
> apic->send_IPI(cpu, NMI_VECTOR);
> }
> +
> +void native_send_rar_single_ipi(int cpu)
> +{
> + apic->send_IPI_mask(cpumask_of(cpu), RAR_VECTOR);
> +}
> +
> +void native_send_rar_ipi(const struct cpumask *mask)
> +{
> + do_native_send_ipi(mask, RAR_VECTOR);
> +}
> #endif /* CONFIG_SMP */
>
> static inline int __prepare_ICR2(unsigned int mask)
> diff --git a/arch/x86/kernel/apic/local.h b/arch/x86/kernel/apic/local.h
> index bdcf609eb283..833669174267 100644
> --- a/arch/x86/kernel/apic/local.h
> +++ b/arch/x86/kernel/apic/local.h
> @@ -38,6 +38,9 @@ static inline unsigned int __prepare_ICR(unsigned int shortcut, int vector,
> case NMI_VECTOR:
> icr |= APIC_DM_NMI;
> break;
> + case RAR_VECTOR:
> + icr |= APIC_DM_RAR;
> + break;
> }
> return icr;
> }
I feel like this patch is doing three separate things:
1. Adds smp_ops
2. Refactors native_send_call_func_ipi()
3. Adds RAR support
None of those are huge, but it would make a lot more sense to break
those out. I'm also still not sure of the point of the smp_ops.
Powered by blists - more mailing lists