irqentry_enter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the pt_regs of 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_enter has to be invoked on entry and ct_irq_exit on 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 🌈


πŸ’œ 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