函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:stress_reorder_work

函数原型:static void stress_reorder_work(struct work_struct *work)

返回类型:void

参数:

类型参数名称
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  如果非order则返回
450 n小于nlocks循环
451  ll等于开辟内存
452  如果非ll则转到:out
455  lock等于locks[order[n]]
456  添加链表项
458  释放内存
459  order = NULL
461  循环
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  如果非err则继续下一循环
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  如果err不等于负EDEADLK
474  pr_err_once("stress (%s) failed with %d\n", __func__, err)
476  退出
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  链表项移动到头部
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  当非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)循环
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  释放内存
493  释放内存
494  释放内存