irqentry_enter(9)
π irqentry_enter β bestie edition
okay so this is a page from the Kernel API Manual, and the star of the show is irqentry_enter(9). buckle up π
β¨ NAME β¨
irqentry_enter β the little function that handles state tracking on ordinary interrupt entries. no cap, that's literally its whole job. πΈ
π¦ SYNOPSIS π¦
irqentry_state_t noinstr irqentry_enter (struct pt_regs *regs );
π ARGUMENTS π
regsβ a pointer to thept_regsof whatever context got interrupted. like, the receipts of the interrupted moment. π§Ύ
π₯ DESCRIPTION π₯
so when this runs, it invokes these three things, and yes they all matter:
- lockdep irqflag state tracking, and it does this as low level ASM entry disabled interrupts. π
- Context tracking, but only if the exception actually hit user mode. π
- The hardirq tracer, to keep the state consistent, again as low level ASM entry disabled interrupts. β
π«Ά as a precondition, this requires that the entry came from user mode, idle, or a kernel context in which RCU is watching. that's the vibe check you gotta pass before you're even allowed in.
For kernel mode entries, the RCU handling is conditional, bestie. two paths, keep up:
- if RCU is watching, the only RCU requirement is to check whether the tick has to be restarted.
- if RCU is not watching, then
ct_irq_enterhas to be invoked on entry andct_irq_exiton exit.
Avoiding those ct_irq_enter/ct_irq_exit calls is an optimization, but it also solves the problem of kernel mode pagefaults which can schedule β and that is not possible after invoking ct_irq_enter without undoing it. so like, don't skip the undoing. π
For user mode entries, irqentry_enter_from_user_mode is invoked to establish the proper context for NOHZ_FULL. otherwise scheduling on exit would not be possible. periodt. π₯
π RETURN π
An opaque object that must be passed to irqentry_exit. it's giving mystery box π¦ β you don't peek inside, you just hand it over. no cap.
π SEE ALSO π
- Kernel file
./include/linux/irq-entry-common.h arch_enter_from_user_mode(9)arch_in_rcu_eqs(9)enter_from_user_mode(9)arch_exit_to_user_mode_work(9)arch_exit_to_user_mode_prepare(9)arch_exit_to_user_mode(9)arch_do_signal_or_restart(9)__exit_to_user_mode_prepare(9)syscall_exit_to_user_mode_prepare(9)irqentry_exit_to_user_mode_prepare(9)exit_to_user_mode(9)irqentry_enter_from_user_mode(9)irqentry_exit_to_user_mode(9)struct irqentry_state(9)irqentry_enter_from_kernel_mode(9)irqentry_exit_to_kernel_mode_preempt(9)irqentry_exit_to_kernel_mode_after_preempt(9)irqentry_exit_to_kernel_mode(9)irqentry_exit(9)irqentry_nmi_enter(9)irqentry_nmi_exit(9)
π and that's the whole page bestie π
cute little sign-off: this one lives in ./include/linux, and the manual dates it October 2026, tagged as irqentry_enter(9) β mwah, iconic, go read the source ilysm ππ¦β¨
π¦ 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