STRUCT RCU_TASKS_PERCPU(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

struct rcu_tasks_percpu β€” okay so this is the per-CPU piece of a Tasks-RCU-like mechanism's definition, and yes that's a mouthful but we're gonna get through it together bestie 🫢

So like, in the Kernel API Manual (that's the manual this page lives in, hiii ✨), this struct is literally the per-CPU component of a Tasks-RCU-style thing. One of these per CPU, no cap.


✨ SYNOPSIS ✨

struct rcu_tasks_percpu {
    struct rcu_segcblist cblist;
    raw_spinlock_t lock;
    unsigned long rtp_jiffies;
    unsigned long rtp_n_lock_retries;
    struct timer_list lazy_timer;
    unsigned int urgent_gp;
    struct work_struct rtp_work;
    struct irq_work rtp_irq_work;
    struct rcu_head barrier_q_head;
    struct list_head rtp_blkd_tasks;
    struct list_head rtp_exit_list;
    int cpu;
    int index;
    struct rcu_tasks *rtpp;
 };

Like, look at her. Fourteen members, all iconic, all doing their own little job πŸ‘‘


πŸŽ€ Members πŸŽ€

Here's the vibe check on every single field, in order, because we do not skip:

  • cblist β€” the callback list. That's it, that's the girl. πŸ’–
  • lock β€” a raw_spinlock_t that protects the per-CPU callback list. Guard her at all costs πŸ”’
  • rtp_jiffies β€” jiffies counter value, but specifically for statistics. Numbers for the vibes πŸ“Š
  • rtp_n_lock_retries β€” a rough lock-contention statistic. Rough! It said rough, don't @ me 😭
  • lazy_timer β€” a timer whose whole personality is unlazifying callbacks. Get up bestie ⏰
  • urgent_gp β€” number of additional non-lazy grace periods. Urgent! 🚨
  • rtp_work β€” work queue for invoking callbacks. She's got a queue and she's working it πŸ’…
  • rtp_irq_work β€” IRQ work queue, for deferred wakeups. Waking up later, on purpose πŸŒ™
  • barrier_q_head β€” an struct rcu_head that serves as the RCU callback for a barrier operation. Barrier queen 🧱
  • rtp_blkd_tasks β€” list of tasks blocked as readers. Free them 😀
  • rtp_exit_list β€” list of tasks in the latter portion of do_exit. They're leaving, let them leave πŸšͺ
  • cpu β€” the CPU number corresponding to this entry. Which CPU? This CPU. πŸ–₯️
  • index β€” index of this CPU in rtpcp_array of the rcu_tasks structure. Your seat number in the group chat πŸͺ‘
  • rtpp β€” pointer to the rcu_tasks structure. Her parent, her home base 🏠
ngl if you're touching lock you better actually be holding it β€” it's the lock protecting the per-CPU callback list, so like, do the thing properly fr fr πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./kernel/rcu/tasks.h plus these besties, go read them too:


okay that's the whole page, you ate that πŸ“ This little number ships from the source ./kernel/rcu, dated October 2026, and it's filed under struct rcu_tasks_percpu(9) β€” mwah, periodt πŸ’œ

πŸ“¦ where this page comes from