rcu_softirq_qs_periodic(9)
π rcu_softirq_qs_periodic(9) β a Kernel API Manual moment
okay bestie, so this one's from the Kernel API Manual, and it's literally the glow-up your long-running softirq handler has been waiting for β¨
πΈ NAME πΈ
rcu_softirq_qs_periodic β reports RCU and RCU-Tasks quiescent states π
π SYNOPSIS π
rcu_softirq_qs_periodic (old_ts );
π¦ ARGUMENTS π¦
old_tsβ thejiffiesat the start of processing. that's it, that's the vibe π«Ά
β DESCRIPTION β
so this helper is specifically for long-running softirq handlers, like NAPI threads in networking β the ones that just keep going and going π the caller should initialize the variable passed in as old_ts at the beginning of the softirq handler, no cap. then, when it gets invoked frequently, this macro will invoke rcu_softirq_qs every 100 milliseconds thereafter, which hands you both RCU and RCU-Tasks quiescent states. iconic behavior honestly π
β οΈ heads up: this macro modifies its old_ts argument. so don't be out here assuming it's gonna stay the same value, because it will not π
because regions of code that have disabled softirq act as RCU read-side critical sections, this macro should be invoked with softirq (and preemption) enabled. like, that's the whole vibe check it needs to pass β
the macro is not needed when CONFIG_PREEMPT_RT is defined π
ββοΈ RT kernels would have more chance to invoke schedule calls and provide the necessary quiescent states, so they're already covered. as a contrast, calling cond_resched only won't achieve the same effect β because cond_resched does not provide RCU-Tasks quiescent states. ngl that's kind of the whole point of the distinction π₯
π SEE ALSO π
kernel file ./include/linux/rcupdate.h plus this absolute squad of related calls, fr fr:
same_state_synchronize_rcu(9)cond_resched_tasks_rcu_qs(9)RCU_LOCKDEP_WARN(9)lockdep_assert_in_rcu_read_lock(9)lockdep_assert_in_rcu_read_lock_bh(9)lockdep_assert_in_rcu_read_lock_sched(9)lockdep_assert_in_rcu_reader(9)unrcu_pointer(9)RCU_INITIALIZER(9)rcu_assign_pointer(9)rcu_replace_pointer(9)rcu_access_pointer(9)rcu_dereference_check(9)rcu_dereference_bh_check(9)rcu_dereference_sched_check(9)rcu_dereference_all_check(9)rcu_dereference_protected(9)rcu_dereference(9)rcu_dereference_bh(9)rcu_dereference_sched(9)rcu_dereference_all(9)rcu_pointer_handoff(9)rcu_read_lock(9)rcu_read_unlock(9)rcu_read_lock_bh(9)rcu_read_unlock_bh(9)rcu_read_lock_sched(9)rcu_read_unlock_sched(9)RCU_INIT_POINTER(9)RCU_POINTER_INITIALIZER(9)kfree_rcu(9)kfree_rcu_mightsleep(9)kfree_rcu_nolock(9)rcu_head_init(9)rcu_head_after_call_rcu(9)
and that's the whole page, bestie π§ this one lives in ./include/linux and it's dated October 2026 β so like, future vibes only π mwah, go forth and report those quiescent states π
β¨
π¦ 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