ct_irq_enter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ct_irq_enter(9) ✨

okay so bestie, this is a page from the Kernel API Manual and it's literally called ct_irq_enter β€” yes the (9) means it's a kernel API function, we love a section-nine moment πŸ’…


🌸 NAME 🌸

ct_irq_enter β€” the little function that tells RCU "hey, this CPU is entering irq, and it's away from idle" 🫢


⭐ SYNOPSIS ⭐

noinstr void ct_irq_enter (void );

πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” no arguments, she takes nothing, she gives everything ✨

πŸ’– DESCRIPTION πŸ’–

So you're entering an interrupt handler β€” which might possibly mean you're exiting idle mode, i.e. entering the mode where read-side critical sections can actually happen. That's the whole vibe. πŸ”₯

Lowkey important: the caller must have disabled interrupts. Not optional. Do it. πŸ™ˆ

Now here's the tea: the Linux kernel is fully capable of entering an interrupt handler that it never exits β€” for example when it's doing upcalls to user mode! Not me being dramatic, that's just real. 😭 This code assumes your idle loop never does upcalls to user mode. So if your architecture's idle loop does do upcalls to user mode (or does literally anything else that results in unbalanced calls to the irq_enter and irq_exit functions), then RCU will give you what you deserve, good and hard. πŸ’€

...but very infrequently and irreproducibly. Which is honestly the worst way to be humbled. πŸ¦‹

Want a workaround for this limitation? Use things like work queues. Slay, problem solved. πŸ‘‘

You have been warned. periodt 🌈

If you add or remove a call to ct_irq_enter, be sure to test with CONFIG_RCU_EQS_DEBUG=y. Like actually test it, bestie, don't just vibe and hope. ⭐


🧚 SEE ALSO 🧚

Kernel file ./kernel/context_tracking.c, plus the whole friend group: ct_nmi_exit(9), ct_nmi_enter(9), ct_idle_enter(9), ct_idle_exit(9), ct_irq_exit(9), __ct_user_enter(9), user_enter_callable(9), __ct_user_exit(9), user_exit_callable(9) πŸ’œ


okay that's the page!! mwah πŸ’‹ this one came out of ./kernel back in October 2026, so go forth and enter those irqs responsibly, iykyk πŸ“πŸ’…

πŸ“¦ where this page comes from