Re: [PATCH 2/3] x86/irq: factor out IS_ERR_OR_NULL check from platfom-specific handle_irq

From: Thomas Gleixner
Date: Mon Aug 19 2019 - 06:41:37 EST


On Sun, 4 Aug 2019, Heiner Kallweit wrote:
> -
> - if (!handle_irq(desc, regs)) {
> + if (IS_ERR_OR_NULL(desc)) {

This really want's an unlikely or preferrably be written as:

if (likely(!IS_ERR_OR_NULL(desc))) {
handle_irq(desc);
} else {

> ack_APIC_irq();
>
> if (desc != VECTOR_RETRIGGERED && desc != VECTOR_SHUTDOWN) {
> @@ -254,6 +253,8 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
> } else {
> __this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
> }
> + } else {
> + handle_irq(desc, regs);
> }
>
> diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
> index 6bf6517a0..cd4595b71 100644
> --- a/arch/x86/kernel/irq_64.c
> +++ b/arch/x86/kernel/irq_64.c
> @@ -26,13 +26,9 @@
> DEFINE_PER_CPU_PAGE_ALIGNED(struct irq_stack, irq_stack_backing_store) __visible;
> DECLARE_INIT_PER_CPU(irq_stack_backing_store);
>
> -bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
> +void handle_irq(struct irq_desc *desc, struct pt_regs *regs)
> {
> - if (IS_ERR_OR_NULL(desc))
> - return false;
> -
> generic_handle_irq_desc(desc);

With that the function call does not make any sense for 64bit. So the
wrapper should be an inline and only for 32bit a function call.

Thanks,

tglx