x86/dovetail: pipeline the thermal APIC sysvec
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
@@ -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
@@ -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
@@ -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
Quoted 8 lines · liuyang
sysvec_thermalwas a non-pipelinedDEFINE_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_VECTORas a pipelined sysvec and dispatch it fromdo_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
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(-)arch/x86/include/asm/idtentry.h +1
-1@@ -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@@ -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@@ -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
Philippe Gerum
AppliedQuoted 6 lines · Florian Bezdeka
Quoted 5 lines · liuyang
sysvec_thermalwas a non-pipelinedDEFINE_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_VECTORas a pipelined sysvec and dispatch it fromdo_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 ]
Reviewed-by Florian Bezdeka <[email protected]>
Merged, thanks.
Signature · 1 line
Philippe.