Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\io-wq.c Create Date:2022-07-28 20:22:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:create_io_worker

Proto:static bool create_io_worker(struct io_wq *wq, struct io_wqe *wqe, int index)

Type:bool

Parameter:

TypeParameterName
struct io_wq *wq
struct io_wqe *wqe
intindex
609  acct = acct[index]
612  worker = kzalloc_node - allocate zeroed memory from a particular memory node.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@node: memory node from which to allocate
613  If Not worker Then Return false
616  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
617  pprev = NULL
618  wqe = wqe
619  Process spin lock initialization( & lock)
621  task = kthread_create_on_node - create a kthread
623  If IS_ERR(task) Then
624  kfree(worker)
625  Return false
628  spin_lock_irq( & lock)
629  hlist_nulls_add_head_rcu*@n: the element to add to the hash list
630  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
631  flags |= IO_WORKER_F_FREE
632  If index == IO_WQ_ACCT_BOUND Then flags |= IO_WORKER_F_BOUND
634  If Not nr_workers && flags & IO_WORKER_F_BOUND Then flags |= IO_WORKER_F_FIXED
636  nr_workers++
637  spin_unlock_irq( & lock)
639  If index == IO_WQ_ACCT_UNBOUND Then atomic_inc( & How many processes does this user have? )
642  wake_up_process - Wake up a specific process*@p: The process to be woken up.* Attempt to wake up the nominated process and move it to the set of runnable* processes.* Return: 1 if the process was woken up, 0 if it was already running.
643  Return true
Caller
NameDescribe
io_wq_managerManager thread. Tasked with creating new workers, if we need them.