函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Do one read-side critical section, returning false if there was* no data to read. Can be invoked both from process context and* from a timer handler.

函数原型:static bool rcu_torture_one_read(struct torture_random_state *trsp)

返回类型:bool

参数:

类型参数名称
struct torture_random_state *trsp
1269  readstate等于0
1270  struct rt_read_seg rtseg[10] = {{0}}
1271  rtrsp等于rtseg[0]
1275  newstate等于Return a random protection state mask, but with at least one bit set.
1276  Do one extension of an RCU read-side critical section using the* current reader state in readstate (set to zero for initial entry* to extended critical section), set the new state as specified by* newstate (set to zero for final exit from extended
1277  started等于get_gp_seq()
1278  ts等于rcu_trace_clock_local()
1279  p等于cu_dereference_check() - rcu_dereference with debug checking*@p: The pointer to read, prior to dereferencing*@c: The conditions under which the dereference will take place* Do an rcu_dereference(), but check that the conditions under which the(rcu_torture_current, _read_lock_bh_held() - might we be in RCU-bh read-side critical section?* Check for bottom half being disabled, which covers both the* CONFIG_PROVE_RCU and not cases || rcu_read_lock_sched_held() || srcu_read_lock_held - might we be in SRCU read-side critical section?*@ssp: The srcu_struct structure to check* If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an SRCU* read-side critical section || torturing_tasks())
1284  如果(p == NULL)则
1286  Do one extension of an RCU read-side critical section using the* current reader state in readstate (set to zero for initial entry* to extended critical section), set the new state as specified by* newstate (set to zero for final exit from extended
1287  返回:false
1289  如果rtort_mbtest恒等于0则atomic_inc( & n_rcu_torture_mberror)
1291  rtrsp等于Do a randomly selected number of extensions of an existing RCU read-side* critical section.
1292  禁止抢占()
1293  pipe_count等于rtort_pipe_count
1294  如果pipe_count大于RCU_TORTURE_PIPE_LEN
1296  pipe_count等于RCU_TORTURE_PIPE_LEN
1298  completed等于get_gp_seq()
1299  如果pipe_count大于1则
1300  do_trace_rcu_torture_read(name, & rtort_rcu, ts, started, completed)
1302  Dump the ftrace buffer, but only one time per callsite per boot.(DUMP_ALL)
1304  __this_cpu_inc(rcu_torture_count[pipe_count])
1305  completed等于rcutorture_seq_diff(completed, started)
1306  如果completed大于RCU_TORTURE_PIPE_LEN
1308  completed等于RCU_TORTURE_PIPE_LEN
1310  __this_cpu_inc(rcu_torture_batch[completed])
1311  禁用抢占和中断()
1312  Do one extension of an RCU read-side critical section using the* current reader state in readstate (set to zero for initial entry* to extended critical section), set the new state as specified by* newstate (set to zero for final exit from extended
1313  WARN_ON_ONCE(readstate & RCUTORTURE_RDR_MASK)
1316  如果pipe_count大于1或completed大于1的值且非xchg( & err_segs_recorded, 1)则
1317  i等于0
1318 rtrsp1小于rtrsp循环err_segs[i++]等于rtrsp1
1320  rt_read_nsegs等于i
1323  返回:true
调用者
名称描述
rcu_torture_timerRCU torture reader from timer handler. Dereferences rcu_torture_current,* incrementing the corresponding element of the pipeline array. The* counter in the element should never be greater than 1, otherwise, the* RCU implementation is broken.
rcu_torture_readerRCU torture reader kthread. Repeatedly dereferences rcu_torture_current,* incrementing the corresponding element of the pipeline array. The* counter in the element should never be greater than 1, otherwise, the* RCU implementation is broken.