/* SPDX-License-Identifier: GPL-2.0+ *//* * Task-based RCU implementations. * * Copyright (C) 2020 Paul E. McKenney */#ifdef CONFIG_TASKS_RCU_GENERIC//////////////////////////////////////////////////////////////////////////// Generic data structures.structrcu_tasks;typedefvoid(*rcu_tasks_gp_func_t)(structrcu_tasks*rtp);typedefvoid(*pregp_func_t)(void);typedefvoid(*pertask_func_t)(structtask_struct*t,structlist_head*hop);typedefvoid(*postscan_func_t)(structlist_head*hop);typedefvoid(*holdouts_func_t)(structlist_head*hop,boolndrpt,bool*frptp);typedefvoid(*postgp_func_t)(structrcu_tasks*rtp);/** * struct rcu_tasks - Definition for a Tasks-RCU-like mechanism. * @cbs_head: Head of callback list. * @cbs_tail: Tail pointer for callback list. * @cbs_wq: Wait queue allowing new callback to get kthread's attention. * @cbs_lock: Lock protecting callback list. * @kthread_ptr: This flavor's grace-period/callback-invocation kthread. * @gp_func: This flavor's grace-period-wait function. * @gp_state: Grace period's most recent state transition (debugging). * @gp_sleep: Per-grace-period sleep to prevent CPU-bound looping. * @init_fract: Initial backoff sleep interval. * @gp_jiffies: Time of last @gp_state transition. * @gp_start: Most recent grace-period start in jiffies. * @n_gps: Number of grace periods completed since boot. * @n_ipis: Number of IPIs sent to encourage grace periods to end. * @n_ipis_fails: Number of IPI-send failures. * @pregp_func: This flavor's pre-grace-period function (optional). * @pertask_func: This flavor's per-task scan function (optional). * @postscan_func: This flavor's post-task scan function (optional). * @holdouts_func: This flavor's holdout-list scan function (optional). * @postgp_func: This flavor's post-grace-period function (optional). * @call_func: This flavor's call_rcu()-equivalent function. * @name: This flavor's textual name. * @kname: This flavor's kthread name. */structrcu_tasks{structrcu_head*cbs_head;structrcu_head**cbs_tail;structwait_queue_headcbs_wq;raw_spinlock_tcbs_lock;intgp_state;intgp_sleep;intinit_fract;unsignedlonggp_jiffies;unsignedlonggp_start;unsignedlongn_gps;unsignedlongn_ipis;unsignedlongn_ipis_fails;structtask_struct*kthread_ptr;rcu_tasks_gp_func_tgp_func;pregp_func_tpregp_func;pertask_func_tpertask_func;postscan_func_tpostscan_func;holdouts_func_tholdouts_func;postgp_func_tpostgp_func;call_rcu_func_tcall_func;char