函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sbitmap_queue_init_node

函数原型:int sbitmap_queue_init_node(struct sbitmap_queue *sbq, unsigned int depth, int shift, bool round_robin, gfp_t flags, int node)

返回类型:int

参数:

类型参数名称
struct sbitmap_queue *sbq
unsigned intdepth
intshift
boolround_robin
gfp_tflags
intnode
358  ret等于sbitmap_init_node( & @sb: Scalable bitmap., depth, shift, flags, node)
359  如果ret则返回:ret
362  @alloc_hint: Cache of last successfully allocated or freed bit.* This is per-cpu, which allows multiple users to stick to different* cachelines until the map is exhausted.等于alloc_percpu_gfp(unsignedint, flags)
363  如果非@alloc_hint: Cache of last successfully allocated or freed bit.* This is per-cpu, which allows multiple users to stick to different* cachelines until the map is exhausted.
364  sbitmap_free() - Free memory used by a &struct sbitmap.*@sb: Bitmap to free.
365  返回:负ENOMEM
368  如果depth且非round_robin
369  遍历可用CPU(i)
370  per_cpu_ptr(@alloc_hint: Cache of last successfully allocated or freed bit.* This is per-cpu, which allows multiple users to stick to different* cachelines until the map is exhausted., i)等于prandom_u32()取模depth
373  @min_shallow_depth: The minimum shallow depth which may be passed to* sbitmap_queue_get_shallow() or __sbitmap_queue_get_shallow().等于UINT_MAX
374  @wake_batch: Number of bits which must be freed before we wake up any* waiters.等于sbq_calc_wake_batch(sbq, depth)
375  atomic_set( & @wake_index: Next wait queue in @ws to wake up., 0)
376  atomic_set( & @ws_active: count of currently active ws waitqueues, 0)
378  @ws: Wait queues.等于根据内存节点分配内存
379  如果非@ws: Wait queues.
380  释放内存
381  sbitmap_free() - Free memory used by a &struct sbitmap.*@sb: Bitmap to free.
382  返回:负ENOMEM
385 i小于SBQ_WAIT_QUEUES循环
386  init_waitqueue_head( & @wait: Wait queue.)
387  atomic_set( & @wait_cnt: Number of frees remaining before we wake up., @wake_batch: Number of bits which must be freed before we wake up any* waiters.)
390  @round_robin: Allocate bits in strict round-robin order.等于round_robin
391  返回:0
调用者
名称描述
kyber_queue_data_alloc
bt_alloc