Skip to contentSkip to conversation

x86/dovetail: pipeline the thermal APIC sysvec

PATCH Applied liuyang 3 participants 3 messages Aug 11 – Aug 17 x86

lore
Share & tools
lore

liuyang

author
#0 lore raw

PATCH 1/1 x86/dovetail: pipeline the thermal APIC sysvec

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.

---
 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(-)
arch/x86/include/asm/idtentry.h +1 -1
index bb1df662d..b8d4995f9 100644
@@ -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
arch/x86/kernel/irq.c +3 -2
index f745f1752..976828a63 100644
@@ -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
arch/x86/kernel/irq_pipeline.c +5 -0
index 00cb779a2..cb267c2e0 100644
@@ -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

Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · liuyang

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.

[ To +Philippe as the "Dovetail" prefix is missing in the subject line ]

Quoted 59 lines
---
 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(-)
arch/x86/include/asm/idtentry.h +1 -1
index bb1df662d..b8d4995f9 100644
@@ -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
arch/x86/kernel/irq.c +3 -2
index f745f1752..976828a63 100644
@@ -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
arch/x86/kernel/irq_pipeline.c +5 -1
index 00cb779a2..cb267c2e0 100644
@@ -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

#2 lore raw
Quoted 6 lines · Florian Bezdeka
Quoted 5 lines · liuyang

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).

Quoted 8 lines
Quoted 3 lines

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.

[ To +Philippe as the "Dovetail" prefix is missing in the subject line ]

Merged, thanks.

Signature · 1 line
Philippe.