函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rcu_torture_init

函数原型:static int __init rcu_torture_init(void)

返回类型:int

参数:

2346  firsterr等于0
2347  static struct rcu_torture_ops * torture_ops[] = { & rcu_ops, & rcu_busted_ops, & srcu_ops, & As above, but dynamically allocated. , & As above, but broken due to inappropriate reader extension. , & tasks_ops, & trivial_ops, }
2352  如果非Initialize torture module则返回:负EBUSY
2356 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(torture_ops)循环
2357  cur_ops等于torture_ops[i]
2358  如果字符串比较恒等于0则退出
2361  如果i恒等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(torture_ops)则
2362  打印警报信息("rcu-torture: invalid torture type: \"%s\"\n", torture_type)
2364  打印警报信息("rcu-torture types:")
2365 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(torture_ops)循环打印标准信息(" %s", name)
2367  打印标准信息("\n")
2368  WARN_ON(!IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0* otherwise.(CONFIG_RCU_TORTURE_TEST))
2369  firsterr等于负EINVAL
2370  cur_ops = NULL
2371  转到:unwind
2373  如果fqs恒等于NULLfqs_duration不等于0则
2374  打印警报信息("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n")
2375  fqs_duration等于0
2377  如果initinit()
2380  如果nreaders大于等于0则
2381  nrealreaders等于nreaders
2382  否则
2383  nrealreaders等于num_online_cpus()减2减nreaders
2384  如果nrealreaders小于等于0则nrealreaders等于1
2387  rcu_torture_print_module_parms(cur_ops, "Start of test")
2391  初始化链表头
2392 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(rcu_tortures)循环
2393  rtort_mbtest等于0
2394  添加链表项
2400  rcu_torture_current = NULL
2401  rcu_torture_current_version等于0
2402  atomic_set( & n_rcu_torture_alloc, 0)
2403  atomic_set( & n_rcu_torture_alloc_fail, 0)
2404  atomic_set( & n_rcu_torture_free, 0)
2405  atomic_set( & n_rcu_torture_mberror, 0)
2406  atomic_set( & n_rcu_torture_error, 0)
2407  n_rcu_torture_barrier_error等于0
2408  n_rcu_torture_boost_ktrerror等于0
2409  n_rcu_torture_boost_rterror等于0
2410  n_rcu_torture_boost_failure等于0
2411  n_rcu_torture_boosts等于0
2412 i小于RCU_TORTURE_PIPE_LEN加1循环atomic_set( & rcu_torture_wcount[i], 0)
2414  遍历可用CPU(cpu)
2415 i小于RCU_TORTURE_PIPE_LEN加1循环
2416  per_cpu(rcu_torture_count, cpu)[i]等于0
2417  per_cpu(rcu_torture_batch, cpu)[i]等于0
2420  err_segs_recorded等于0
2421  rt_read_nsegs等于0
2425  firsterr等于torture_create_kthread(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")., NULL, writer_task)
2427  如果firsterr则转到:unwind
2429  如果nfakewriters大于0则
2430  fakewriter_tasks等于分配数组内存并置零
2433  如果(fakewriter_tasks == NULL)则
2434  VERBOSE_TOROUT_ERRSTRING("out of memory")
2435  firsterr等于负ENOMEM
2436  转到:unwind
2439 i小于nfakewriters循环
2440  firsterr等于torture_create_kthread(RCU torture fake writer kthread. Repeatedly calls sync, with a random* delay between calls., NULL, fakewriter_tasks[i])
2442  如果firsterr则转到:unwind
2445  reader_tasks等于分配数组内存并置零
2447  如果(reader_tasks == NULL)则
2448  VERBOSE_TOROUT_ERRSTRING("out of memory")
2449  firsterr等于负ENOMEM
2450  转到:unwind
2452 i小于nrealreaders循环
2453  firsterr等于torture_create_kthread(RCU 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., (void * )i, reader_tasks[i])
2455  如果firsterr则转到:unwind
2458  如果stat_interval大于0则
2459  firsterr等于torture_create_kthread(Periodically prints torture statistics, if periodic statistics printing* was specified via the stat_interval module parameter., NULL, stats_task)
2461  如果firsterr则转到:unwind
2464  如果test_no_idle_hzshuffle_interval大于0则
2465  firsterr等于torture_shuffle_init(shuffle_interval * HZ)
2466  如果firsterr则转到:unwind
2469  如果stutter小于0则stutter等于0
2471  如果stutter
2474  t等于如果stall_durstall_dur()否则stutterHZ
2475  firsterr等于torture_stutter_init(stutter * HZ, t)
2476  如果firsterr则转到:unwind
2479  如果fqs_duration小于0则fqs_duration等于0
2481  如果fqs_duration
2483  firsterr等于torture_create_kthread(RCU torture force-quiescent-state kthread. Repeatedly induces* bursts of calls to force_quiescent_state(), increasing the probability* of occurrence of some important types of race conditions., NULL, fqs_task)
2485  如果firsterr则转到:unwind
2488  如果test_boost_interval小于1则test_boost_interval等于1
2490  如果test_boost_duration小于2则test_boost_duration等于2
2492  如果rcu_torture_can_boost()则
2494  jiffies of next boost test start. 等于jiffiestest_boost_intervalHZ
2496  firsterr等于puhp_setup_state - Setup hotplug state callbacks with calling the callbacks*@state: The state for which the calls are installed*@name: Name of the callback (will be used in debug output)*@startup: startup callback function*@teardown: teardown callback
2499  如果firsterr小于0则转到:unwind
2501  rcutor_hp等于firsterr
2503  shutdown_jiffies等于jiffiesshutdown_secsHZ
2504  firsterr等于torture_shutdown_init(shutdown_secs, rcu_torture_cleanup)
2505  如果firsterr则转到:unwind
2507  firsterr等于torture_onoff_init(onoff_holdoff * HZ, onoff_interval, rcutorture_sync)
2509  如果firsterr则转到:unwind
2511  firsterr等于Spawn CPU-stall kthread, if stall_cpu specified.
2512  如果firsterr则转到:unwind
2514  firsterr等于If forward-progress checking is requested and feasible, spawn the thread.
2515  如果firsterr则转到:unwind
2517  firsterr等于Initialize RCU barrier testing.
2518  如果firsterr则转到:unwind
2520  如果object_debugVerify that double-free causes debug-objects to complain, but only* if CONFIG_DEBUG_OBJECTS_RCU_HEAD=y. Otherwise, say that the test* cannot be carried out.
2522  Tell the torture module that initialization is complete.
2523  返回:0
2525  unwind :
2526  Tell the torture module that initialization is complete.
2527  rcu_torture_cleanup()
2528  返回:firsterr