[PATCH v1] x86/dovetail: pipeline the thermal APIC sysvec

liuyang <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
sysvec_thermal was a non-pipelined DEFINE_IDTENTRY_SYSVEC (with a real
__apic_eoi()). Under thermal load we still hit stalls while that
handler ran against in-band timer paths (therm_throt_process ->
add_timer_on).

Handle THERMAL_APIC_VECTOR as a pipelined sysvec and dispatch it from
do_sysvec_inband(), so thermal runs on the in-band stage like other
pipelined system vectors.

Signed-off-by: liuyang <[email protected]>
---
 arch/x86/include/asm/idtentry.h | 2 +-
 arch/x86/kernel/irq.c           | 5 +++--
 arch/x86/kernel/irq_pipeline.c  | 5 +++++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
index bb1df662d..b8d4995f9 100644
--- a/arch/x86/include/asm/idtentry.h
+++ b/arch/x86/include/asm/idtentry.h
@@ -816,7 +816,7 @@ DECLARE_IDTENTRY_SYSVEC(DEFERRED_ERROR_VECTOR,		sysvec_deferred_error);
 # endif

 # ifdef CONFIG_X86_THERMAL_VECTOR
-DECLARE_IDTENTRY_SYSVEC(THERMAL_APIC_VECTOR,		sysvec_thermal);
+DECLARE_IDTENTRY_SYSVEC_PIPELINED(THERMAL_APIC_VECTOR,		sysvec_thermal);
 # else
 # define fred_sysvec_thermal				NULL
 # endif
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index f745f1752..976828a63 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -582,12 +582,13 @@ static void smp_thermal_vector(void)
 		       smp_processor_id());
 }

-DEFINE_IDTENTRY_SYSVEC(sysvec_thermal)
+DEFINE_IDTENTRY_SYSVEC_PIPELINED(THERMAL_APIC_VECTOR,
+				sysvec_thermal)
 {
 	trace_thermal_apic_entry(THERMAL_APIC_VECTOR);
 	inc_irq_stat(irq_thermal_count);
 	smp_thermal_vector();
 	trace_thermal_apic_exit(THERMAL_APIC_VECTOR);
-	__apic_eoi();
+	apic_eoi();
 }
 #endif
diff --git a/arch/x86/kernel/irq_pipeline.c b/arch/x86/kernel/irq_pipeline.c
index 00cb779a2..cb267c2e0 100644
--- a/arch/x86/kernel/irq_pipeline.c
+++ b/arch/x86/kernel/irq_pipeline.c
@@ -176,6 +176,11 @@ static void do_sysvec_inband(struct irq_desc *desc, struct pt_regs *regs)
 	case LOCAL_TIMER_VECTOR:
 		run_sysvec_on_irqstack_cond(__sysvec_apic_timer_interrupt, regs);
 		break;
+#ifdef CONFIG_X86_THERMAL_VECTOR
+	case THERMAL_APIC_VECTOR:
+		run_sysvec_on_irqstack_cond(__sysvec_thermal, regs);
+		break;
+#endif
 	default:
 		printk_once(KERN_ERR "irq_pipeline: unexpected event"
 			" on vector #%.2x (irq=%u)", vector, irq);
--
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.