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

Name:stress_one_work

Proto:static void stress_one_work(struct work_struct *work)

Type:void

Parameter:

TypeParameterName
struct work_struct *work
499  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)
500  nlocks = nlocks
501  lock = locks + get_random_int() % nlocks
504  Do
505  err = ww_mutex_lock(lock, NULL)
506  If Not err Then
509  Else
510  pr_err_once("stress (%s) failed with %d\n", __func__, err)
512  Break
514  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
516  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.