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:54:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__test_mutex

Proto:static int __test_mutex(unsigned int flags)

Type:int

Parameter:

TypeParameterName
unsigned intflags
55  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.
56  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
58  INIT_WORK_ONSTACK( & work, test_mutex_work)
59  init_completion( & ready)
60  init_completion( & go)
61  init_completion( & done)
62  flags = flags
64  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
66  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
67  ww_mutex_lock( & mutex, (flags & TEST_MTX_CTX) ? & ctx : NULL)
68  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.
69  If flags & TEST_MTX_SPIN Then
70  timeout = jiffies + TIMEOUT
72  ret = 0
73  Do
75  ret = -EINVAL
76  Break
78  cond_resched()
79  When time_before(jiffies, timeout) cycle
80  Else
81  ret = wait_for_completion_timeout: - waits for completion of a task (w/timeout)*@x: holds the state of this particular completion*@timeout: timeout value in jiffies* This waits for either a completion of a specific task to be signaled or for a
83  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
84  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.
86  If ret Then
87  pr_err("%s(flags=%x): mutual exclusion failure\n", __func__, flags)
89  ret = -EINVAL
92  lush_work - wait for a work to finish executing the last queueing instance*@work: the work to flush* Wait until @work has finished execution
93  destroy_work_on_stack( & work)
94  Return ret
Caller
NameDescribe
test_mutex