函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:RCU torture writer kthread. Repeatedly substitutes a new structure* for that pointed to by rcu_torture_current, freeing the old structure* after a series of grace periods (the "pipeline").

函数原型:static int rcu_torture_writer(void *arg)

返回类型:int

参数:

类型参数名称
void *arg
941  can_expedite等于非Should normal grace-period primitives be expedited? Intended for* use within RCU. Note that this function takes the rcu_expedited* sysfs/boot variable and rcu_scheduler_active into account as well* as the rcu_expedite_gp() nesting且非Should expedited grace-period primitives always fall back to their* non-expedited counterparts? Intended for use within RCU. Note* that if the user specifies both rcu_expedited and rcu_normal, then* rcu_normal wins
942  expediting等于0
944  gp_cond1等于gp_cond, gp_exp1等于gp_exp, gp_normal1等于gp_normal
945  gp_sync1等于gp_sync
949  static
950  int synctype[] = {RTWS_DEF_FREE, RTWS_EXP_SYNC, RTWS_COND_GET, RTWS_SYNC}
952  nsynctypes等于0
954  VERBOSE_TOROUT_STRING("rcu_torture_writer task started")
955  如果非can_expedite打印警报信息("%s"TORTURE_FLAG" GP expediting controlled from boot/sysfs for %s.\n", torture_type, name)
961  如果非gp_cond1且非gp_exp1且非gp_normal1且非gp_sync1gp_cond1 = gp_exp1 = gp_normal1 = gp_sync1 = true
963  如果gp_cond1get_statecond_sync
964  synctype[nsynctypes++]等于RTWS_COND_GET
965  打印信息("%s: Testing conditional GPs.\n", __func__)
966  否则如果gp_cond且非get_state或非cond_sync的值则
967  打印警报信息("%s: gp_cond without primitives.\n", __func__)
969  如果gp_exp1exp_sync
970  synctype[nsynctypes++]等于RTWS_EXP_SYNC
971  打印信息("%s: Testing expedited GPs.\n", __func__)
972  否则如果gp_exp且非exp_sync
973  打印警报信息("%s: gp_exp without primitives.\n", __func__)
975  如果gp_normal1deferred_free
976  synctype[nsynctypes++]等于RTWS_DEF_FREE
977  打印信息("%s: Testing asynchronous GPs.\n", __func__)
978  否则如果gp_normal且非deferred_free
979  打印警报信息("%s: gp_normal without primitives.\n", __func__)
981  如果gp_sync1sync
982  synctype[nsynctypes++]等于RTWS_SYNC
983  打印信息("%s: Testing normal GPs.\n", __func__)
984  否则如果gp_sync且非sync
985  打印警报信息("%s: gp_sync without primitives.\n", __func__)
987  如果WARN_ONCE(nsynctypes == 0, "rcu_torture_writer: No update-side primitives.\n")则
994  rcu_torture_writer_state等于RTWS_STOPPING
995  Each kthread must wait for kthread_should_stop() before returning from* its top-level function, otherwise segfaults ensue
998  循环
999  rcu_torture_writer_state等于RTWS_FIXED_DELAY
1000  schedule_timeout_uninterruptible(1)
1001  rp等于Allocate an element from the rcu_tortures pool.
1002  如果(rp == NULL)则继续下一循环
1004  rtort_pipe_count等于0
1005  rcu_torture_writer_state等于RTWS_DELAY
1006  0x10c7 is 2**32 / 1000000 (rounded up) (torture_random( & rand) & 0x3ff)
1007  rcu_torture_writer_state等于RTWS_REPLACE
1008  old_rp等于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, 当前进程 == writer_task)
1010  rtort_mbtest等于1
1011  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization(rcu_torture_current, rp)
1012  smp_wmb()
1013  如果old_rp
1014  i等于rtort_pipe_count
1015  如果i大于RCU_TORTURE_PIPE_LENi等于RCU_TORTURE_PIPE_LEN
1018  rtort_pipe_count自加
1045  默认
1046  WARN_ON_ONCE(1)
1047  退出
1050  WRITE_ONCE(rcu_torture_current_version, rcu_torture_current_version + 1)
1053  如果can_expedite且非torture_random( & rand)按位与0xff按位与非非expediting减1的值则
1060  如果expediting先自加大于3则expediting等于负expediting
1062  否则如果非can_expedite
1066  rcu_torture_writer_state等于RTWS_STUTTER
1067  如果Task stuttering, which forces load/no-load transitions. 且非READ_ONCE(Short rcu_torture_delay() delays. )且非slow_gps且非Is it time for the current torture test to stop?则以i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(rcu_tortures)循环
1076  WARN(1, "%s: rtort_pipe_count: %d\n", __func__, rtort_pipe_count)
1078  当非Is it time for the current torture test to stop?循环
1080  如果expediting大于0则expediting等于负expediting
1082 can_expediteexpediting自加小于0循环
1083  _unexpedite_gp - Cancel prior rcu_expedite_gp() invocation* Undo a prior call to rcu_expedite_gp()
1084  WARN_ON_ONCE(can_expedite && Should normal grace-period primitives be expedited? Intended for* use within RCU. Note that this function takes the rcu_expedited* sysfs/boot variable and rcu_scheduler_active into account as well* as the rcu_expedite_gp() nesting)
1085  如果非can_expedite打印警报信息("%s"TORTURE_FLAG" Dynamic grace-period expediting was disabled.\n", torture_type)
1089  rcu_torture_writer_state等于RTWS_STOPPING
1090  Each kthread must wait for kthread_should_stop() before returning from* its top-level function, otherwise segfaults ensue
1091  返回:0