函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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)

函数原型:int rdmacg_try_charge(struct rdma_cgroup **rdmacg, struct rdmacg_device *device, enum rdmacg_resource_type index)

返回类型:int

参数:

类型参数名称
struct rdma_cgroup **rdmacg
struct rdmacg_device *device
enum rdmacg_resource_typeindex
266  ret等于0
268  如果index大于等于RDMACG_RESOURCE_MAX则返回:负EINVAL
275  cg等于get_current_rdmacg()
277  mutex_lock( & Protects list of resource pools maintained on per cgroup basis* and rdma device list.)
278 p循环
279  rpool等于get_cg_rpool_locked(p, device)
280  如果是错误
281  ret等于错误
282  转到:err
283  否则
284  new等于usage加1
285  如果new大于max
286  ret等于负EAGAIN
287  转到:err
288  否则
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  返回: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  返回:ret