Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static void rcutorture_one_extend(int *readstate, int newstate, struct torture_random_state *trsp, struct rt_read_seg *rtrsp)

Type:void

Parameter:

TypeParameterName
int *readstate
intnewstate
struct torture_random_state *trsp
struct rt_read_seg *rtrsp
1147  idxnew = -1
1148  idxold = readstate
1149  statesnew = ~readstate & newstate
1150  statesold = readstate & ~newstate
1152  WARN_ON_ONCE(idxold < 0)
1153  WARN_ON_ONCE((idxold >> Put SRCU index in upper bits. ) > 1)
1154  rt_readstate = newstate
1157  If statesnew & Extend readers by disabling bh. Then local_bh_disable()
1159  If statesnew & ... disabling interrupts. Then local_irq_disable()
1161  If statesnew & ... disabling preemption. Then Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
1163  If statesnew & ... rcu_read_lock_bh(). Then _read_lock_bh() - mark the beginning of an RCU-bh critical section* This is equivalent of rcu_read_lock(), but also disables softirqs
1165  If statesnew & ... rcu_read_lock_sched(). Then _read_lock_sched() - mark the beginning of a RCU-sched critical section* This is equivalent of rcu_read_lock(), but disables preemption.* Read-side critical sections can also be introduced by anything else
1167  If statesnew & ... entering another RCU reader. Then idxnew = readlock() << Put SRCU index in upper bits.
1171  If statesold & ... disabling interrupts. Then The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
1173  If statesold & Extend readers by disabling bh. Then local_bh_enable()
1175  If statesold & ... disabling preemption. Then preempt_enable()
1177  If statesold & ... rcu_read_lock_bh(). Then _read_unlock_bh - marks the end of a softirq-only RCU critical section* See rcu_read_lock_bh() for more information.
1179  If statesold & ... rcu_read_lock_sched(). Then _read_unlock_sched - marks the end of a RCU-classic critical section* See rcu_read_lock_sched for more information.
1181  If statesold & ... entering another RCU reader. Then readunlock(idxold >> Put SRCU index in upper bits. )
1185  If (statesnew || statesold) && readstate && newstate Then read_delay(trsp, rtrsp)
1189  If idxnew == -1 Then idxnew = idxold & ~RCUTORTURE_RDR_MASK
1191  WARN_ON_ONCE(idxnew < 0)
1192  WARN_ON_ONCE((idxnew >> Put SRCU index in upper bits. ) > 1)
1193  readstate = idxnew | newstate
1194  WARN_ON_ONCE(( * readstate >> Put SRCU index in upper bits. ) < 0)
1195  WARN_ON_ONCE(( * readstate >> Put SRCU index in upper bits. ) > 1)
Caller
NameDescribe
rcutorture_loop_extendDo a randomly selected number of extensions of an existing RCU read-side* critical section.
rcu_torture_one_readDo 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.