函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:padata_alloc - allocate and initialize a padata instance and specify* cpumasks for serial and parallel workers

函数原型:static struct padata_instance *padata_alloc(const char *name, const struct cpumask *pcpumask, const struct cpumask *cbcpumask)

返回类型:struct padata_instance

参数:

类型参数名称
const char *name
const struct cpumask *pcpumask
const struct cpumask *cbcpumask
973  pinst等于分配内存并置零
974  如果非pinst则转到:err
977  parallel_wq等于alloc_workqueue("%s_parallel", WQ_UNBOUND, 0, name)
979  如果非parallel_wq则转到:err_free_inst
982  get_online_cpus()
984  serial_wq等于alloc_workqueue("%s_serial", WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE, 1, name)
986  如果非serial_wq则转到:err_put_cpus
989  如果非分配CPU掩码则转到:err_free_serial_wq
991  如果非分配CPU掩码
992  释放CPU掩码
993  转到:err_free_serial_wq
995  如果非If cpumask contains no active cpu, we mark the instance as invalid. 或非If cpumask contains no active cpu, we mark the instance as invalid. 则转到:err_free_masks
999  如果非分配CPU掩码则转到:err_free_masks
1001  如果非分配CPU掩码则转到:err_free_rcpumask_pcpu
1003  如果非分配CPU掩码则转到:err_free_rcpumask_cbcpu
1006  初始化链表头
1008  pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
1009  pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
1010  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
1011  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
1013  如果padata_setup_cpumasks(pinst)则转到:err_free_omask
1016  flags等于0
1018  BLOCKING_INIT_NOTIFIER_HEAD( & cpumask_change_notifier)
1019  kobject_init() - Initialize a kobject structure
1020  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.( & lock)
1028  put_online_cpus()
1030  返回:pinst
1032  err_free_omask :
1033  释放CPU掩码
1034  err_free_rcpumask_cbcpu :
1035  释放CPU掩码
1036  err_free_rcpumask_pcpu :
1037  释放CPU掩码
1038  err_free_masks :
1039  释放CPU掩码
1040  释放CPU掩码
1041  err_free_serial_wq :
1042  destroy_workqueue - safely terminate a workqueue*@wq: target workqueue* Safely destroy a workqueue. All work currently pending will be done first.
1043  err_put_cpus :
1044  put_online_cpus()
1045  destroy_workqueue - safely terminate a workqueue*@wq: target workqueue* Safely destroy a workqueue. All work currently pending will be done first.
1046  err_free_inst :
1047  kfree(pinst)
1048  err :
1049  返回:NULL
调用者
名称描述
padata_alloc_possiblepadata_alloc_possible - Allocate and initialize padata instance.* Use the cpu_possible_mask for serial and* parallel workers.*@name: used to identify the instance