函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:allocate the attrs and pwqs for later installation

函数原型:static struct apply_wqattrs_ctx *apply_wqattrs_prepare(struct workqueue_struct *wq, const struct workqueue_attrs *attrs)

返回类型:struct apply_wqattrs_ctx

参数:

类型参数名称
struct workqueue_struct *wq
const struct workqueue_attrs *attrs
3895  lockdep_assert_held( & wq_pool_mutex)
3897  ctx等于分配内存并置零
3899  new_attrs等于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.
3900  tmp_attrs等于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.
3901  如果非ctx或非new_attrs或非tmp_attrs则转到:out_free
3909  copy_workqueue_attrs(new_attrs, attrs)
3910  pumask_and - *dstp = *src1p & *src2p*@dstp: the cpumask result*@src1p: the first input*@src2p: the second input* If *@dstp is empty, returns 0, else returns 1
3911  如果此条件成立可能性小(为编译器优化)(pumask_empty - *srcp == 0*@srcp: the cpumask to that all cpus < nr_cpu_ids are clear.)则pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
3919  copy_workqueue_attrs(tmp_attrs, new_attrs)
3926  dfl_pwq等于btain a pool matching @attr and create a pwq associating the pool and @wq
3927  如果非dfl_pwq则转到:out_free
3930  for_each_node(node)
3933  如果非pwq_tbl[node]则转到:out_free
3935  否则
3936  L: reference count 自加
3937  pwq_tbl[node]等于dfl_pwq
3942  copy_workqueue_attrs(new_attrs, attrs)
3943  pumask_and - *dstp = *src1p & *src2p*@dstp: the cpumask result*@src1p: the first input*@src2p: the second input* If *@dstp is empty, returns 0, else returns 1
3944  attrs to apply 等于new_attrs
3946  arget workqueue 等于wq
3947  _workqueue_attrs - free a workqueue_attrs*@attrs: workqueue_attrs to free* Undo alloc_workqueue_attrs().
3948  返回:ctx
3950  out_free :
3951  _workqueue_attrs - free a workqueue_attrs*@attrs: workqueue_attrs to free* Undo alloc_workqueue_attrs().
3952  _workqueue_attrs - free a workqueue_attrs*@attrs: workqueue_attrs to free* Undo alloc_workqueue_attrs().
3953  the resources after success or abort
3954  返回:NULL
调用者
名称描述
apply_workqueue_attrs_locked
workqueue_apply_unbound_cpumask