Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Carry out need_resched()/cond_resched() forward-progress testing.

Proto:static void rcu_torture_fwd_prog_nr(int *tested, int *tested_tries)

Type:void

Parameter:

TypeParameterName
int *tested
int *tested_tries
1786  bool selfpropcb = false
1788  static
1790  If call && sync && cb_barrier Then
1791  init_rcu_head_on_stack( & rh)
1792  selfpropcb = true
1796  WRITE_ONCE(Short rcu_torture_delay() delays. , true)
1797  sync()
1798  If selfpropcb Then
1799  WRITE_ONCE(stop, 0)
1800  call( & rh, Forward-progress self-propagating RCU callback function. Because* callbacks run from softirq, this function is an implicit RCU read-side* critical section.)
1802  cver = READ_ONCE(rcu_torture_current_version)
1803  gps = get_gp_seq()
1804  sd = stall_dur() + 1
1805  sd4 = ( sd + fwd_progress_div - 1) / fwd_progress_div
1806  dur = sd4 + torture_random( & trs) % (sd - sd4)
1807  WRITE_ONCE(rcu_fwd_startat, jiffies)
1808  stopat = rcu_fwd_startat + dur
1809  When time_before(jiffies, stopat) && Not Stop aggressive CPU-hog tests a bit before the end of the test in order* to avoid interfering with test shutdown. && Not READ_ONCE(rcu_fwd_emergency_stop) && Not Is it time for the current torture test to stop? cycle
1812  idx = readlock()
1813  0x10c7 is 2**32 / 1000000 (rounded up) (10)
1814  readunlock(idx)
1815  If Not fwd_progress_need_resched || need_resched() Then cond_resched()
1818  tested_tries++
1819  If Not time_before(jiffies, stopat) && Not Stop aggressive CPU-hog tests a bit before the end of the test in order* to avoid interfering with test shutdown. && Not READ_ONCE(rcu_fwd_emergency_stop) && Not Is it time for the current torture test to stop? Then
1822  tested++
1823  cver = READ_ONCE(rcu_torture_current_version) - cver
1824  gps = rcutorture_seq_diff(get_gp_seq(), gps)
1825  WARN_ON(!cver && gps < 2)
1826  pr_alert("%s: Duration %ld cver %ld gps %ld\n", __func__, dur, cver, gps)
1828  If selfpropcb Then
1829  WRITE_ONCE(stop, 1)
1830  sync()
1831  cb_barrier()
1834  If selfpropcb Then
1835  WARN_ON(READ_ONCE(stop) != 2)
1836  destroy_rcu_head_on_stack( & rh)
1838  schedule_timeout_uninterruptible(HZ / 10)
1839  WRITE_ONCE(Short rcu_torture_delay() delays. , false)
Caller
NameDescribe
rcu_torture_fwd_progCarry out grace-period forward-progress testing.