函数逻辑报告 |
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 |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称: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 |
| 942 | expediting等于0 |
| 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_sync1则gp_cond1 = gp_exp1 = gp_normal1 = gp_sync1 = true |
| 964 | synctype[nsynctypes++]等于RTWS_COND_GET |
| 970 | synctype[nsynctypes++]等于RTWS_EXP_SYNC |
| 975 | 如果gp_normal1且deferred_free则 |
| 976 | synctype[nsynctypes++]等于RTWS_DEF_FREE |
| 978 | 否则如果gp_normal且非deferred_free则 |
| 982 | synctype[nsynctypes++]等于RTWS_SYNC |
| 987 | 如果WARN_ONCE(nsynctypes == 0, "rcu_torture_writer: No update-side primitives.\n")则 |
| 998 | 循环 |
| 1000 | schedule_timeout_uninterruptible(1) |
| 1002 | 如果(rp == NULL)则继续下一循环 |
| 1004 | rtort_pipe_count等于0 |
| 1006 | 0x10c7 is 2**32 / 1000000 (rounded up) (torture_random( & rand) & 0x3ff) |
| 1010 | rtort_mbtest等于1 |
| 1012 | smp_wmb() |
| 1013 | 如果old_rp则 |
| 1014 | i等于rtort_pipe_count |
| 1015 | 如果i大于RCU_TORTURE_PIPE_LEN则i等于RCU_TORTURE_PIPE_LEN |
| 1017 | atomic_inc( & rcu_torture_wcount[i]) |
| 1018 | rtort_pipe_count自加 |
| 1020 | 当:synctype[torture_random( & rand) % nsynctypes]恒等于RTWS_DEF_FREE |
| 1024 | 当:synctype[torture_random( & rand) % nsynctypes]恒等于RTWS_EXP_SYNC |
| 1029 | 当:synctype[torture_random( & rand) % nsynctypes]恒等于RTWS_COND_GET |
| 1032 | i等于torture_random( & rand)取模16 |
| 1033 | 如果i不等于0则schedule_timeout_interruptible(i) |
| 1035 | 0x10c7 is 2**32 / 1000000 (rounded up) (torture_random( & rand) % 1000) |
| 1039 | 退出 |
| 1040 | 当:synctype[torture_random( & rand) % nsynctypes]恒等于RTWS_SYNC |
| 1045 | 默认 |
| 1046 | WARN_ON_ONCE(1) |
| 1047 | 退出 |
| 1053 | 如果can_expedite且非torture_random( & rand)按位与0xff按位与非非expediting减1的值则 |
| 1058 | 否则_unexpedite_gp - Cancel prior rcu_expedite_gp() invocation* Undo a prior call to rcu_expedite_gp() |
| 1060 | 如果expediting先自加大于3则expediting等于负expediting |
| 1062 | 否则如果非can_expedite则 |
| 1076 | WARN(1, "%s: rtort_pipe_count: %d\n", __func__, rtort_pipe_count) |
| 1080 | 如果expediting大于0则expediting等于负expediting |
| 1082 | 当can_expedite且expediting自加小于0循环 |
| 1083 | _unexpedite_gp - Cancel prior rcu_expedite_gp() invocation* Undo a prior call to rcu_expedite_gp() |
| 1085 | 如果非can_expedite则打印警报信息("%s"TORTURE_FLAG" Dynamic grace-period expediting was disabled.\n", torture_type) |
| 1091 | 返回:0 |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |