poll_state_...ize_rcu_full(9)
π poll_state_...ize_rcu_full(9) π
okay bestie, welcome to the Kernel API Manual β this is your RCU grace-period polling vibe check, and lowkey the whole page ate. No cap. π«Άβ¨
πΈ NAME πΈ
poll_state_synchronize_rcu_full β Has the specified RCU grace period completed?
π¦ SYNOPSIS π¦
bool poll_state_synchronize_rcu_full (struct rcu_gp_seq *gsp );
π ARGUMENTS π
gspβ the value you got fromget_state_synchronize_rcu_fullorstart_poll_synchronize_rcu_full.
π DESCRIPTION π
If a full RCU grace period has elapsed since the earlier call from which *gsp was obtained, return true, otherwise return false. If false is returned, it is the caller's responsibility to invoke this function later on until it does return true β yes, bestie, that's your main character responsibility, fr fr. Alternatively, the caller can explicitly wait for a grace period, for example, by passing gsp to cond_synchronize_rcu or by directly invoking synchronize_rcu.
Yes, this function does not take counter wrap into account. But counter wrap is harmless β periodt. If the counter wraps, we have waited for more than a billion grace periods (and way more on a 64-bit system!) ππ₯. Those needing to keep rcu_gp_seq values for very long time periods (many hours even on 32-bit systems) should check them occasionally and either refresh them or set a flag indicating that the grace period has completed. Alternatively, they can use get_completed_synchronize_rcu_full to get a guaranteed-completed grace-period state.
This function provides the same memory-ordering guarantees that would be provided by a synchronize_rcu that was invoked at the call to the function that provided gsp, and that returned at the end of this function. And this guarantee requires that the root rcu_node structure's ->gp_seq field be checked instead of that of the rcu_state structure. The problem is that the just-ending grace-period's callbacks can be invoked between the time that the root rcu_node structure's ->gp_seq field is updated and the time that the rcu_state structure's ->gp_seq field is updated. Therefore, if a single synchronize_rcu is to cause a subsequent poll_state_synchronize_rcu_full to return true, then the root rcu_node structure is the one that needs to be polled. Highkey important, so stay with me π
.
π₯ SEE ALSO π₯
Kernel file: ./kernel/rcu/tree.c. And the whole squad, iykyk:
rcu_softirq_qs(9)rcu_watching_snap_stopped_since(9)rcu_is_cpu_rrupt_from_idle(9)rcu_irq_exit_check_preempt(9)__rcu_irq_enter_check_tick(9)rcu_is_watching(9)rcu_set_gpwrap_lag(9)call_rcu_hurry(9)call_rcu(9)synchronize_rcu(9)get_completed_synchronize_rcu_full(9)get_state_synchronize_rcu(9)get_state_synchronize_rcu_full(9)start_poll_synchronize_rcu(9)start_poll_synchronize_rcu_full(9)poll_state_synchronize_rcu(9)cond_synchronize_rcu(9)cond_synchronize_rcu_full(9)rcu_barrier(9)rcu_barrier_throttled(9)
okay that's the whole page, bestie π
source/version: ./kernel/rcu, dated October 2026, for poll_state_...ize_rcu_full(9). bye and slay your grace periods ππ
π¦ 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