ct_irq_enter(9)
β¨ 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
- 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