synchronize_hardirq(9)
okay bestie, welcome to synchronize_hardirq(9) from the Kernel API Manual β manual name folded in near the top like a little name tag, we're being cute and correct today. This one is giving βwait for pending hard IRQ handlers (on other CPUs) to finish,β and the vibe check is please do not deadlock yourself. π
β¨ NAME β¨
synchronize_hardirqβ wait for pending hard IRQ handlers (on other CPUs). That's literally the whole name-lane, bestie.
π¦ SYNOPSIS π¦
bool synchronize_hardirq (unsigned int irq );
π ARGUMENTS π
irqβ the interrupt number to wait for. That's the one you're stalking until it's done. π
πΈ DESCRIPTION πΈ
So here's the tea: this function waits for any pending hard IRQ handlers for this interrupt to complete before returning. It's a βlet the hardirq finish firstβ moment, no cap.
π¨ Deadlock warning, fr fr: if you use this function while holding a resource the IRQ handler may need, you will deadlock. That's not a vibe. That's a whole system freeze.
It does not take associated threaded handlers into account. So if you're expecting threaded-handler coverage from this function, bestie, that's not what this is doing.
β οΈ Do not use this for shutdown scenarios where you must be sure that all parts (hardirq and threaded handler) have completed. That is a different requirement, and this function is not that girl.
This function may be called β with care β from IRQ context. The βwith careβ is doing a lot of heavy lifting there, so respect it. π«Ά
It also does not check whether there is an interrupt in flight at the hardware level, but not serviced yet. Why? Because this might deadlock when called with interrupts disabled and the target CPU of the interrupt is the current CPU. Literally the current CPU. The audacity. π
π₯ RETURN π₯
false if a threaded handler is active. That's the return detail, and we are keeping it exactly as it is.
π SEE ALSO π
The kernel file in question is ./kernel/irq/manage.c, and the cross-reference besties are:
synchronize_irq(9)irq_can_set_affinity(9)irq_can_set_affinity_usr(9)irq_set_thread_affinity(9)irq_affinity_schedule_notify_work(9)irq_update_affinity_desc(9)irq_set_affinity(9)irq_force_affinity(9)irq_set_affinity_notifier(9)irq_set_vcpu_affinity(9)disable_irq_nosync(9)disable_irq(9)disable_hardirq(9)disable_nmi_nosync(9)enable_irq(9)enable_nmi(9)irq_set_irq_wake(9)irq_wake_thread(9)free_irq(9)request_threaded_irq(9)request_any_context_irq(9)request_nmi(9)irq_percpu_is_enabled(9)free_percpu_irq(9)request_percpu_irq_affinity(9)request_percpu_nmi(9)prepare_percpu_nmi(9)teardown_percpu_nmi(9)irq_get_irqchip_state(9)irq_set_irqchip_state(9)irq_has_action(9)irq_check_status_bit(9)
catch u later, ./kernel/irq β’ October 2026 β’ synchronize_hardirq(9) ππ«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms