函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\rcu\srcutree.c Create Date:2022-07-27 11:18:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Initialize SRCU combining tree. Note that statically allocated* srcu_struct structures might already have srcu_read_lock() and* srcu_read_unlock() running against them. So if the is_static parameter

函数原型:static void init_srcu_struct_nodes(struct srcu_struct *ssp, bool is_static)

返回类型:void

参数:

类型参数名称
struct srcu_struct *ssp
boolis_static
87  level等于0
94  level[0]等于node[0]
95 i小于rcu_num_lvls循环level[i]等于level[i - 1]加num_rcu_lvl[i - 1]
97  Compute the per-level fanout, either using the exact fanout specified* or balancing the tree, depending on the rcu_fanout_exact boot parameter.
101  spin_lock_init( & ACCESS_PRIVATE(snp, lock))
102  WARN_ON_ONCE(ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(srcu_have_cbs) != ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(srcu_data_have_cbs))
104 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(srcu_have_cbs)循环
105  srcu_have_cbs[i]等于0
106  srcu_data_have_cbs[i]等于0
108  srcu_gp_seq_needed_exp等于0
109  grplo等于负1
110  grphi等于负1
111  如果snp恒等于node[0]则
113  srcu_parent = NULL
114  继续下一循环
118  如果snp恒等于level[level + 1]则level自加
120  srcu_parent等于level[level - 1]加snplevel[level]的差除levelspread[level - 1]
129  WARN_ON_ONCE(ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(srcu_lock_count) != ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(srcu_unlock_count))
131  level等于rcu_num_lvls减1
132  snp_first等于level[level]
133  遍历可用CPU(cpu)
134  sdp等于per_cpu_ptr(sda, cpu)
135  spin_lock_init( & ACCESS_PRIVATE(sdp, lock))
136  rcu_segcblist_init( & srcu_cblist)
137  srcu_cblist_invoking = false
138  srcu_gp_seq_needed等于srcu_gp_seq
139  srcu_gp_seq_needed_exp等于srcu_gp_seq
140  mynode等于snp_first[cpu / levelspread[level]]
141 snp != NULL循环
142  如果grplo小于0则grplo等于cpu
144  grphi等于cpu
146  cpu等于cpu
147  INIT_WORK( & work, srcu_invoke_callbacks)
148  imer_setup - prepare a timer for first use*@timer: the timer in question*@callback: the function to call when timer expires*@flags: any TIMER_* flags* Regular timer initialization should use either DEFINE_TIMER() above,* or timer_setup()( & delay_work, srcu_delay_timer, 0)
149  ssp等于ssp
150  grpmask等于1左移cpugrplo
151  如果is_static则继续下一循环
156  srcu_lock_count[i]等于0
157  srcu_unlock_count[i]等于0
调用者
名称描述
init_srcu_struct_fieldsInitialize non-compile-time initialized fields, including the* associated srcu_node and srcu_data structures. The is_static* parameter is passed through to init_srcu_struct_nodes(), and* also tells us that ->sda has already been wired up to srcu_data.