函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:stress

函数原型:static int stress(int nlocks, int nthreads, unsigned int flags)

返回类型:int

参数:

类型参数名称
intnlocks
intnthreads
unsigned intflags
529  locks等于分配数组内存
530  如果非locks则返回:负ENOMEM
533 n小于nlocks循环ww_mutex_init - initialize the w/w mutex*@lock: the mutex to be initialized*@ww_class: the w/w class the mutex should belong to* Initialize the w/w mutex to unlocked state and associate it with the given* class.
536 nthreads循环
538  void( * fn)(struct work_struct * work)
540  fn = NULL
542  : & == 0
543  如果flags按位与STRESS_INORDERfn等于stress_inorder_work
545  退出
546  : & == 1
547  如果flags按位与STRESS_REORDERfn等于stress_reorder_work
549  退出
550  : & == 2
551  如果flags按位与STRESS_ONEfn等于stress_one_work
553  退出
556  如果非fn则继续下一循环
559  stress等于开辟内存
560  如果非stress退出
563  INIT_WORK( & work, fn)
564  locks等于locks
565  nlocks等于nlocks
566  timeout等于jiffies加2乘HZ
568  queue_work - queue work on a workqueue*@wq: workqueue to use*@work: work to queue* Returns %false if @work was already on a queue, %true otherwise.* We queue the work to the CPU on which it was submitted, but if the CPU dies
569  nthreads自减
572  lush_workqueue - ensure that any scheduled work has run to completion.*@wq: workqueue to flush* This function sleeps until all work items which were queued on entry* have finished execution, but it is not livelocked by new incoming ones.
574 n小于nlocks循环ww_mutex_destroy - mark a w/w mutex unusable*@lock: the mutex to be destroyed* This function marks the mutex uninitialized, and any subsequent* use of the mutex is forbidden. The mutex must not be locked when* this function is called.
576  释放内存
578  返回:0
调用者
名称描述
test_ww_mutex_init