Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cgroup\rdma.c Create Date:2022-07-28 11:14:59
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:dmacg_try_charge - hierarchically try to charge the rdma resource*@rdmacg: pointer to rdma cgroup which will own this resource*@device: pointer to rdmacg device*@index: index of the resource to charge in cgroup (resource pool)

Proto:int rdmacg_try_charge(struct rdma_cgroup **rdmacg, struct rdmacg_device *device, enum rdmacg_resource_type index)

Type:int

Parameter:

TypeParameterName
struct rdma_cgroup **rdmacg
struct rdmacg_device *device
enum rdmacg_resource_typeindex
266  ret = 0
268  If index >= RDMACG_RESOURCE_MAX Then Return -EINVAL
275  cg = get_current_rdmacg()
277  mutex_lock( & Protects list of resource pools maintained on per cgroup basis* and rdma device list.)
278  When p cycle
279  rpool = get_cg_rpool_locked(p, device)
280  If IS_ERR(rpool) Then
281  ret = PTR_ERR(rpool)
282  Go to err
283  Else
284  new = usage + 1
285  If new > max Then
286  ret = -EAGAIN
287  Go to err
288  Else
294  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
296  rdmacg = cg
297  Return 0
299  err :
300  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
301  dmacg_uncharge_hierarchy - hierarchically uncharge rdma resource count*@device: pointer to rdmacg device*@stop_cg: while traversing hirerchy, when meet with stop_cg cgroup* stop uncharging*@index: index of the resource to uncharge in cg in given resource
302  Return ret