函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__sbitmap_queue_get_shallow

函数原型:int __sbitmap_queue_get_shallow(struct sbitmap_queue *sbq, unsigned int shallow_depth)

返回类型:int

参数:

类型参数名称
struct sbitmap_queue *sbq
unsigned intshallow_depth
455  WARN_ON_ONCE(shallow_depth < @min_shallow_depth: The minimum shallow depth which may be passed to* sbitmap_queue_get_shallow() or __sbitmap_queue_get_shallow().)
457  hint等于Operations with implied preemption/interrupt protection. These* operations can be used without worrying about preemption or interrupt.( * @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.)
458  depth等于READ_ONCE(@depth: Number of bits used in the whole bitmap.)
459  如果此条件成立可能性小(为编译器优化)(hint >= depth)则
460  hint等于如果depthprandom_u32()取模depth否则0
461  抢占保护下的写CPU( * @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., hint)
463  nr等于sbitmap_get_shallow( & @sb: Scalable bitmap., hint, shallow_depth)
465  如果nr恒等于负1则
467  抢占保护下的写CPU( * @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., 0)
468  否则如果nr恒等于hint此条件成立可能性小(为编译器优化)(@round_robin: Allocate bits in strict round-robin order.)则
470  hint等于nr加1
471  如果hint大于等于depth减1则hint等于0
473  抢占保护下的写CPU( * @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., hint)
476  返回:nr
调用者
名称描述
__blk_mq_get_tag