Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\test-ww_mutex.c Create Date:2022-07-28 09:55:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:test_abba

Proto:static int test_abba(bool resolve)

Type:int

Parameter:

TypeParameterName
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  If resolve && err == -EDEADLK Then
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  If Not err Then 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
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  If resolve Then
222  If err || result Then
223  pr_err("%s: failed to resolve ABBA deadlock, A err=%d, B err=%d\n", __func__, err, result)
225  ret = -EINVAL
227  Else
228  If err != -EDEADLK && result != -EDEADLK Then
229  pr_err("%s: missed ABBA deadlock, A err=%d, B err=%d\n", __func__, err, result)
231  ret = -EINVAL
234  Return ret
Caller
NameDescribe
test_ww_mutex_init