函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:stress_inorder_work

函数原型:static void stress_inorder_work(struct work_struct *work)

返回类型:void

参数:

类型参数名称
struct work_struct *work
380  stress等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(work, typeof( * stress), work)
381  nlocks等于nlocks
382  locks等于locks
386  order等于get_random_order(nlocks)
387  如果非order则返回
390  循环
391  contended等于负1
394  ww_acquire_init - initialize a w/w acquire context*@ctx: w/w acquire context to initialize*@ww_class: w/w class of the context* Initializes an context to acquire multiple mutexes of the given w/w class
395  retry :
396  err等于0
397 n小于nlocks循环
398  如果n恒等于contended则继续下一循环
401  err等于ww_mutex_lock( & locks[order[n]], & ctx)
402  如果err小于0则退出
405  如果非errdummy_load(stress)
408  如果contended大于nww_mutex_unlock - release the w/w mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously with any of the* ww_mutex_lock* functions (with or without an acquire context). It is
410  contended等于n
411 n自减循环
412  ww_mutex_unlock - release the w/w mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously with any of the* ww_mutex_lock* functions (with or without an acquire context). It is
414  如果err恒等于负EDEADLK
416  转到:retry
419  如果err
420  pr_err_once("stress (%s) failed with %d\n", __func__, err)
422  退出
425  ww_acquire_fini - releases a w/w acquire context*@ctx: the acquire context to free* Releases a w/w acquire context. This must be called _after_ all acquired w/w* mutexes have been released with ww_mutex_unlock.
426  当非These inlines deal with timer wrapping correctly. You are * strongly encouraged to use them* 1. Because people otherwise forget* 2. Because if the timer wrap changes in future you won't have to* alter your driver code.(jiffies, timeout)循环
428  释放内存
429  释放内存