函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:test_abba

函数原型:static int test_abba(bool resolve)

返回类型:int

参数:

类型参数名称
boolresolve
190  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.
191  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.
192  INIT_WORK_ONSTACK( & work, test_abba_work)
193  init_completion( & a_ready)
194  init_completion( & b_ready)
195  resolve等于resolve
197  schedule_work - put work task in global workqueue*@work: job to be done* Returns %false if @work was already on the kernel-global workqueue and* %true otherwise
199  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
200  ww_mutex_lock( & a_mutex, & ctx)
202  mplete: - signals a single thread waiting on this completion*@x: holds the state of this particular completion* This will wake up a single thread waiting on this completion. Threads will be* awakened in the same order in which they were queued.
203  wait_for_completion: - waits for completion of a task*@x: holds the state of this particular completion* This waits to be signaled for completion of a specific task. It is NOT* interruptible and there is no timeout.* See also similar routines (i
205  err等于ww_mutex_lock( & b_mutex, & ctx)
206  如果resolveerr恒等于负EDEADLK
207  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
208  ww_mutex_lock_slow - slowpath acquiring of the w/w mutex*@lock: the mutex to be acquired*@ctx: w/w acquire context* Acquires a w/w mutex with the given context after a die case
209  err等于ww_mutex_lock( & a_mutex, & ctx)
212  如果非errww_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
214  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
215  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.
217  lush_work - wait for a work to finish executing the last queueing instance*@work: the work to flush* Wait until @work has finished execution
218  destroy_work_on_stack( & work)
220  ret等于0
221  如果resolve
222  如果errresult
223  打印错误信息("%s: failed to resolve ABBA deadlock, A err=%d, B err=%d\n", __func__, err, result)
225  ret等于负EINVAL
227  否则
228  如果err不等于负EDEADLKresult不等于负EDEADLK
229  打印错误信息("%s: missed ABBA deadlock, A err=%d, B err=%d\n", __func__, err, result)
231  ret等于负EINVAL
234  返回:ret
调用者
名称描述
test_ww_mutex_init