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

Name:stress_inorder_work

Proto:static void stress_inorder_work(struct work_struct *work)

Type:void

Parameter:

TypeParameterName
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  If Not order Then Return
390  Do
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  When n < nlocks cycle
398  If n == contended Then Continue
401  err = ww_mutex_lock( & locks[order[n]], & ctx)
402  If err < 0 Then Break
405  If Not err Then dummy_load(stress)
408  If contended > n 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
410  contended = n
411  When n-- cycle
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  If err == -EDEADLK Then
416  Go to retry
419  If err Then
420  pr_err_once("stress (%s) failed with %d\n", __func__, err)
422  Break
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  When Not 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) cycle
428  kfree - free previously allocated memory*@objp: pointer returned by kmalloc.* If @objp is NULL, no operation is performed.* Don't free memory not originally allocated by kmalloc()* or you will run into trouble.
429  kfree - free previously allocated memory*@objp: pointer returned by kmalloc.* If @objp is NULL, no operation is performed.* Don't free memory not originally allocated by kmalloc()* or you will run into trouble.