Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\percpu-refcount.c Create Date:2022-07-28 06:24:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:percpu_ref_init - initialize a percpu refcount*@ref: percpu_ref to initialize*@release: function which will be called when refcount hits 0*@flags: PERCPU_REF_INIT_* flags*@gfp: allocation mask to use* Initializes @ref

Proto:int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release, unsigned int flags, gfp_t gfp)

Type:int

Parameter:

TypeParameterName
struct percpu_ref *ref
percpu_ref_func_t *release
unsigned intflags
gfp_tgfp
63  align = max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, 1 << __PERCPU_REF_FLAG_BITS, __alignof__(unsignedlong))
65  start_count = 0
67  * The low bit of the pointer indicates whether the ref is in percpu * mode; if set, then get/put will manipulate the atomic_t. = __alloc_percpu_gfp(sizeof(unsignedlong), align, gfp)
69  If Not * The low bit of the pointer indicates whether the ref is in percpu * mode; if set, then get/put will manipulate the atomic_t. Then Return -ENOMEM
72  force_atomic = flags & PERCPU_REF_INIT_ATOMIC
73  allow_reinit = flags & PERCPU_REF_ALLOW_REINIT
75  If flags & (PERCPU_REF_INIT_ATOMIC | PERCPU_REF_INIT_DEAD) Then
76  * The low bit of the pointer indicates whether the ref is in percpu * mode; if set, then get/put will manipulate the atomic_t. |= __PERCPU_REF_ATOMIC
77  allow_reinit = true
78  Else
79  start_count += Initially, a percpu refcount is just a set of percpu counters
82  If flags & PERCPU_REF_INIT_DEAD Then * The low bit of the pointer indicates whether the ref is in percpu * mode; if set, then get/put will manipulate the atomic_t. |= __PERCPU_REF_DEAD
84  Else start_count++
87  atomic_long_set( & count, start_count)
89  release = release
90  confirm_switch = NULL
91  Return 0
Caller
NameDescribe
css_create
cgroup_createThe returned cgroup is fully initialized including its control mask, but* it isn't associated with its kernfs_node and doesn't have the control* mask applied.
cgroup_bpf_inheritgroup_bpf_inherit() - inherit effective programs from parent*@cgrp: the cgroup to modify
blkg_alloclkg_alloc - allocate a blkg*@blkcg: block cgroup the new blkg is associated with*@q: request_queue the new blkg is associated with*@gfp_mask: allocation mask to use* Allocate a new blkg assocating @blkcg and @q.
ioctx_allocx_alloc* Allocates and initializes an ioctx. Returns an ERR_PTR if it failed.
io_ring_ctx_alloc
hd_ref_init