Function report |
Source Code:kernel\padata.c |
Create Date:2022-07-28 13:48:05 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:padata_alloc - allocate and initialize a padata instance and specify* cpumasks for serial and parallel workers
Proto:static struct padata_instance *padata_alloc(const char *name, const struct cpumask *pcpumask, const struct cpumask *cbcpumask)
Type:struct padata_instance
Parameter:
Type | Parameter | Name |
---|---|---|
const char * | name | |
const struct cpumask * | pcpumask | |
const struct cpumask * | cbcpumask |
973 | pinst = 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). |
977 | parallel_wq = alloc_workqueue("%s_parallel", WQ_UNBOUND, 0, name) |
979 | If Not parallel_wq Then Go to err_free_inst |
982 | get_online_cpus() |
984 | serial_wq = alloc_workqueue("%s_serial", WQ_MEM_RECLAIM | WQ_CPU_INTENSIVE, 1, name) |
986 | If Not serial_wq Then Go to err_put_cpus |
989 | If Not alloc_cpumask_var( & pcpu, GFP_KERNEL) Then Go to err_free_serial_wq |
991 | If Not alloc_cpumask_var( & cbcpu, GFP_KERNEL) Then |
992 | free_cpumask_var(pcpu) |
993 | Go to err_free_serial_wq |
995 | If Not If cpumask contains no active cpu, we mark the instance as invalid. || Not If cpumask contains no active cpu, we mark the instance as invalid. Then Go to err_free_masks |
999 | If Not alloc_cpumask_var( & pcpu, GFP_KERNEL) Then Go to err_free_masks |
1001 | If Not alloc_cpumask_var( & cbcpu, GFP_KERNEL) Then Go to err_free_rcpumask_pcpu |
1003 | If Not alloc_cpumask_var( & omask, GFP_KERNEL) Then Go to err_free_rcpumask_cbcpu |
1013 | If padata_setup_cpumasks(pinst) Then Go to err_free_omask |
1016 | flags = 0 |
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 | Return pinst |
1032 | err_free_omask : |
1033 | free_cpumask_var(omask) |
1034 | err_free_rcpumask_cbcpu : |
1035 | free_cpumask_var(cbcpu) |
1036 | err_free_rcpumask_pcpu : |
1037 | free_cpumask_var(pcpu) |
1038 | err_free_masks : |
1039 | free_cpumask_var(pcpu) |
1040 | free_cpumask_var(cbcpu) |
1041 | err_free_serial_wq : |
1043 | err_put_cpus : |
1044 | put_online_cpus() |
1046 | err_free_inst : |
1048 | err : |
1049 | Return NULL |
Name | Describe |
---|---|
padata_alloc_possible | padata_alloc_possible - Allocate and initialize padata instance.* Use the cpu_possible_mask for serial and* parallel workers.*@name: used to identify the instance |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |