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

Name:stress_reorder_work

Proto:static void stress_reorder_work(struct work_struct *work)

Type:void

Parameter:

TypeParameterName
struct work_struct *work
439  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)
440  LIST_HEAD(locks)
446  order = get_random_order(nlocks)
447  If Not order Then Return
450  When n < nlocks cycle
451  ll = Allocation memory
452  If Not ll Then Go to out
455  lock = locks[order[n]]
456  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
458  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.
459  order = NULL
461  Do
462  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
465  err = ww_mutex_lock(lock, & ctx)
466  If Not err Then Continue
469  ln = ll
470  list_for_each_entry_continue_reverse - iterate backwards from the given point*@pos: the type * to use as a loop cursor(ln, & locks, link)
471  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
473  If err != -EDEADLK Then
474  pr_err_once("stress (%s) failed with %d\n", __func__, err)
476  Break
479  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
480  list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
483  dummy_load(stress)
484  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(ll, & locks, link)
485  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
487  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.
488  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
490  out :
491  list_for_each_entry_safe - iterate over list of given type safe against removal of list entry*@pos: the type * to use as a loop cursor.*@n: another type * to use as temporary storage*@head: the head for your list.(ll, ln, & locks, link)
492  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.
493  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.
494  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.