Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:io_wq_create

Proto:struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)

Type:struct io_wq

Parameter:

TypeParameterName
unsignedbounded
struct io_wq_data *data
1031  ret = -ENOMEM
1034  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).
1035  If Not wq Then Return ERR_PTR( - ENOMEM)
1038  wqes = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
1039  If Not wqes Then
1040  kfree(wq)
1041  Return ERR_PTR( - ENOMEM)
1044  get_work = get_work
1045  put_work = put_work
1048  user = user
1049  creds = creds
1051  for_each_node(node)
1053  alloc_node = node
1055  If Not node_online(alloc_node) Then alloc_node = NUMA_NO_NODE
1057  wqe = 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
1058  If Not wqe Then Go to err
1060  wqes[node] = wqe
1061  node = alloc_node
1062  max_workers = bounded
1063  atomic_set( & nr_running, 0)
1064  If user Then
1068  atomic_set( & nr_running, 0)
1069  wq = wq
1070  Process spin lock initialization( & lock)
1071  INIT_WQ_LIST( & work_list)
1072  INIT_HLIST_NULLS_HEAD( & free_list, 0)
1073  Initialization list head
1076  init_completion( & done)
1079  mm = mm
1081  manager = Create kernel thread(Manager thread. Tasked with creating new workers, if we need them., wq, "io_wq_manager")
1082  If Not IS_ERR(manager) Then
1083  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.
1084  wait_for_completion: - waits for completion of a task*@x: holds the state of this particular completion* This waits to be signaled for completion of a specific task. It is NOT* interruptible and there is no timeout.* See also similar routines (i
1086  ret = -ENOMEM
1087  Go to err
1089  _completion - reinitialize a completion structure*@x: pointer to completion structure that is to be reinitialized* This inline function should be used to reinitialize a completion structure so it can* be reused
1090  Return wq
1093  ret = PTR_ERR(manager)
1094  mplete: - signals a single thread waiting on this completion*@x: holds the state of this particular completion* This will wake up a single thread waiting on this completion. Threads will be* awakened in the same order in which they were queued.
1095  err :
1096  for_each_node(node)
1097  kfree(wqes[node])
1098  kfree(wqes)
1099  kfree(wq)
1100  Return ERR_PTR(ret)