Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\z3fold.c Create Date:2022-07-28 16:29:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:z3fold_create_pool() - create a new z3fold pool*@name: pool name*@gfp: gfp flags when allocating the z3fold pool structure*@ops: user-defined operations for the z3fold pool* Return: pointer to the new z3fold pool or NULL if the metadata allocation* failed.

Proto:static struct z3fold_pool *z3fold_create_pool(const char *name, gfp_t gfp, const struct z3fold_ops *ops)

Type:struct z3fold_pool

Parameter:

TypeParameterName
const char *name
gfp_tgfp
const struct z3fold_ops *ops
993  struct z3fold_pool * pool = NULL
996  pool = 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).
997  If Not pool Then Go to out
999  c_handle = kmem_cache_create - Create a cache.*@name: A string which is used in /proc/slabinfo to identify this cache.*@size: The size of objects to be created in this cache.*@align: The required alignment for the objects.*@flags: SLAB flags
1002  If Not c_handle Then Go to out_c
1004  Process spin lock initialization( & lock)
1005  Process spin lock initialization( & stale_lock)
1006  unbuddied = allocate one copy of the object for every present
1007  If Not unbuddied Then Go to out_pool
1009  for_each_possible_cpu(cpu)
1010  unbuddied = per_cpu_ptr(unbuddied, cpu)
1012  for_each_unbuddied_list(i, 0)
1013  Initialization list head
1015  Initialization list head
1016  Initialization list head
1017  atomic64_set( & pages_nr, 0)
1018  name = name
1019  compact_wq = create_singlethread_workqueue(name)
1020  If Not compact_wq Then Go to out_unbuddied
1022  release_wq = create_singlethread_workqueue(name)
1023  If Not release_wq Then Go to out_wq
1025  If z3fold_register_migration(pool) Then Go to out_rwq
1027  INIT_WORK( & work, free_pages_work)
1028  ops = ops
1029  Return pool
1031  out_rwq :
1032  destroy_workqueue - safely terminate a workqueue*@wq: target workqueue* Safely destroy a workqueue. All work currently pending will be done first.
1033  out_wq :
1034  destroy_workqueue - safely terminate a workqueue*@wq: target workqueue* Safely destroy a workqueue. All work currently pending will be done first.
1035  out_unbuddied :
1036  free previously allocated percpu memory
1037  out_pool :
1038  kmem_cache_destroy(c_handle)
1039  out_c :
1040  kfree(pool)
1041  out :
1042  Return NULL
Caller
NameDescribe
z3fold_zpool_create