Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\rcu\srcutree.c Create Date:2022-07-28 10:18:22
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:static void init_srcu_struct_nodes(struct srcu_struct *ssp, bool is_static)

Type:void

Parameter:

TypeParameterName
struct srcu_struct *ssp
boolis_static
87  level = 0
94  level[0] = node[0]
95  When i < rcu_num_lvls cycle 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  Process spin lock initialization( & 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  When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(srcu_have_cbs) cycle
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  If snp == node[0] Then
113  srcu_parent = NULL
114  Continue
118  If snp == level[level + 1] Then level++
120  srcu_parent = level[level - 1] + (snp - level[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  for_each_possible_cpu(cpu)
134  sdp = per_cpu_ptr(sda, cpu)
135  Process spin lock initialization( & 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  When snp != NULL cycle
142  If grplo < 0 Then 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 << cpu - grplo
151  If is_static Then Continue
156  srcu_lock_count[i] = 0
157  srcu_unlock_count[i] = 0
Caller
NameDescribe
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.