Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\workqueue.c Create Date:2022-07-28 09:27:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alloc_workqueue

Proto:struct workqueue_struct *alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...)

Type:struct workqueue_struct

Parameter:

TypeParameterName
const char *fmt
unsigned intflags
intmax_active
4225  tbl_size = 0
4237  If flags & WQ_UNBOUND && max_active == 1 Then flags |= __WQ_ORDERED
4241  If flags & WQ_POWER_EFFICIENT && see the comment above the definition of WQ_POWER_EFFICIENT Then flags |= WQ_UNBOUND
4245  If flags & WQ_UNBOUND Then tbl_size = nr_node_ids * size of PWR: unbound pwqs indexed by node [0]
4248  wq = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
4249  If Not wq Then Return NULL
4252  If flags & WQ_UNBOUND Then
4253  PW: only for unbound wqs = alloc_workqueue_attrs - allocate a workqueue_attrs* Allocate a new workqueue_attrs, initialize with default settings and* return it.* Return: The allocated new workqueue_attr on success. %NULL on failure.
4254  If Not PW: only for unbound wqs Then Go to err_free_wq
4258  va_start(args, max_active)
4259  vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally
4260  va_end(args)
4262  max_active = If max_active Else WQ_DFL_ACTIVE
4263  max_active = wq_clamp_max_active(max_active, flags, I: workqueue name )
4266  hot fields used during command issue, aligned to cacheline = flags
4267  WQ: saved pwq max_active = max_active
4268  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & protects this wq )
4269  atomic_set( & lush in progress , 0)
4270  Initialization list head
4271  Initialization list head
4272  Initialization list head
4273  Initialization list head
4275  wq_init_lockdep(wq)
4276  Initialization list head
4278  If alloc_and_link_pwqs(wq) < 0 Then Go to err_unreg_lockdep
4281  If can kworkers be created yet? && Workqueues which may be used during memory reclaim should have a rescuer* to guarantee forward progress. < 0 Then Go to err_destroy
4284  If hot fields used during command issue, aligned to cacheline & WQ_SYSFS && workqueue_sysfs_register(wq) Then Go to err_destroy
4292  mutex_lock( & wq_pool_mutex)
4294  mutex_lock( & protects this wq )
4295  r_each_pwq - iterate through all pool_workqueues of the specified workqueue*@pwq: iteration cursor*@wq: the target workqueue* This must be called either with wq->mutex held or RCU read locked(pwq, wq)
4296  pwq_adjust_max_active - update a pwq's max_active to the current setting*@pwq: target pool_workqueue* If @pwq isn't freezing, set @pwq->max_active to the associated* workqueue's saved_max_active and activate delayed work items* accordingly
4297  mutex_unlock( & protects this wq )
4299  list_add_tail_rcu - add a new entry to rcu-protected list*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head
4301  mutex_unlock( & wq_pool_mutex)
4303  Return wq
4305  err_unreg_lockdep :
4306  wq_unregister_lockdep(wq)
4307  wq_free_lockdep(wq)
4308  err_free_wq :
4309  _workqueue_attrs - free a workqueue_attrs*@attrs: workqueue_attrs to free* Undo alloc_workqueue_attrs().
4310  free previously allocated memory
4311  Return NULL
4312  err_destroy :
4313  destroy_workqueue - safely terminate a workqueue*@wq: target workqueue* Safely destroy a workqueue. All work currently pending will be done first.
4314  Return NULL
Caller
NameDescribe
workqueue_init_earlyworkqueue_init_early - early init for workqueue subsystem* This is the first half of two-staged workqueue subsystem initialization* and invoked as soon as the bare basics - memory allocation, cpumasks and* idr are up
test_ww_mutex_init
pm_start_workqueue
rcu_init
cgroup_wq_init
cgroup1_wq_init
padata_allocpadata_alloc - allocate and initialize a padata instance and specify* cpumasks for serial and parallel workers
default_bdi_init
blk_dev_init
blkcg_init
throtl_init
bio_integrity_init
fscrypt_initscrypt_init() - Set up for fs encryption.
fsverity_init_workqueue