Message ID | 20230906090246.v13.3.I7209db47ef8ec151d3de61f59005bbc59fe8f113@changeid (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64: Add IPI for backtraces / kgdb; try to use NMI for some IPIs | expand |
Mark, On Wed, Sep 6, 2023 at 9:06 AM Douglas Anderson <dianders@chromium.org> wrote: > > +#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL > +void arch_send_wakeup_ipi(unsigned int cpu) > +{ > + /* > + * We use a scheduler IPI to wake the CPU as this avoids the need for a > + * dedicated IPI and we can safely handle spurious scheduler IPIs. > + */ > + arch_smp_send_reschedule(cpu); I was backporting this to our ChromeOS kernels and our build test bot noticed that arch_smp_send_reschedule() didn't exist in older kernels. That's fine--I can always adjust this patch when backporting or cherry-pick extra patches, but it made me wonder. Is there a reason you chose to use arch_smp_send_reschedule() directly here instead of smp_send_reschedule()? I guess the only difference is that you're bypassing the tracing. Is that on purpose? Should we add a comment about it, or change this to smp_send_reschedule()? Thanks! -Doug
Hi, On Mon, Sep 25, 2023 at 5:39 PM Doug Anderson <dianders@chromium.org> wrote: > > Mark, > > On Wed, Sep 6, 2023 at 9:06 AM Douglas Anderson <dianders@chromium.org> wrote: > > > > +#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL > > +void arch_send_wakeup_ipi(unsigned int cpu) > > +{ > > + /* > > + * We use a scheduler IPI to wake the CPU as this avoids the need for a > > + * dedicated IPI and we can safely handle spurious scheduler IPIs. > > + */ > > + arch_smp_send_reschedule(cpu); > > I was backporting this to our ChromeOS kernels and our build test bot > noticed that arch_smp_send_reschedule() didn't exist in older kernels. > That's fine--I can always adjust this patch when backporting or > cherry-pick extra patches, but it made me wonder. Is there a reason > you chose to use arch_smp_send_reschedule() directly here instead of > smp_send_reschedule()? I guess the only difference is that you're > bypassing the tracing. Is that on purpose? Should we add a comment > about it, or change this to smp_send_reschedule()? FWIW, I posted a patch changing this to smp_send_reschedule(). Please yell if this is incorrect. https://lore.kernel.org/r/20231002094526.2.I2e6d22fc42ccbf6b26465a28a10e36e05ccf3075@changeid
diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h index 9b31e6d0da17..efb13112b408 100644 --- a/arch/arm64/include/asm/smp.h +++ b/arch/arm64/include/asm/smp.h @@ -89,9 +89,9 @@ extern void arch_send_call_function_single_ipi(int cpu); extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL -extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask); +extern void arch_send_wakeup_ipi(unsigned int cpu); #else -static inline void arch_send_wakeup_ipi_mask(const struct cpumask *mask) +static inline void arch_send_wakeup_ipi(unsigned int cpu) { BUILD_BUG(); } diff --git a/arch/arm64/kernel/acpi_parking_protocol.c b/arch/arm64/kernel/acpi_parking_protocol.c index b1990e38aed0..e1be29e608b7 100644 --- a/arch/arm64/kernel/acpi_parking_protocol.c +++ b/arch/arm64/kernel/acpi_parking_protocol.c @@ -103,7 +103,7 @@ static int acpi_parking_protocol_cpu_boot(unsigned int cpu) &mailbox->entry_point); writel_relaxed(cpu_entry->gic_cpu_id, &mailbox->cpu_id); - arch_send_wakeup_ipi_mask(cpumask_of(cpu)); + arch_send_wakeup_ipi(cpu); return 0; } diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 960b98b43506..a5848f1ef817 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -72,7 +72,6 @@ enum ipi_msg_type { IPI_CPU_CRASH_STOP, IPI_TIMER, IPI_IRQ_WORK, - IPI_WAKEUP, NR_IPI }; @@ -764,7 +763,6 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = { [IPI_CPU_CRASH_STOP] = "CPU stop (for crash dump) interrupts", [IPI_TIMER] = "Timer broadcast interrupts", [IPI_IRQ_WORK] = "IRQ work interrupts", - [IPI_WAKEUP] = "CPU wake-up interrupts", }; static void smp_cross_call(const struct cpumask *target, unsigned int ipinr); @@ -797,13 +795,6 @@ void arch_send_call_function_single_ipi(int cpu) smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC); } -#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL -void arch_send_wakeup_ipi_mask(const struct cpumask *mask) -{ - smp_cross_call(mask, IPI_WAKEUP); -} -#endif - #ifdef CONFIG_IRQ_WORK void arch_irq_work_raise(void) { @@ -897,14 +888,6 @@ static void do_handle_IPI(int ipinr) break; #endif -#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL - case IPI_WAKEUP: - WARN_ONCE(!acpi_parking_protocol_valid(cpu), - "CPU%u: Wake-up IPI outside the ACPI parking protocol\n", - cpu); - break; -#endif - default: pr_crit("CPU%u: Unknown IPI message 0x%x\n", cpu, ipinr); break; @@ -979,6 +962,17 @@ void arch_smp_send_reschedule(int cpu) smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE); } +#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL +void arch_send_wakeup_ipi(unsigned int cpu) +{ + /* + * We use a scheduler IPI to wake the CPU as this avoids the need for a + * dedicated IPI and we can safely handle spurious scheduler IPIs. + */ + arch_smp_send_reschedule(cpu); +} +#endif + #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST void tick_broadcast(const struct cpumask *mask) {