Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__sbitmap_queue_get_shallow

Proto:int __sbitmap_queue_get_shallow(struct sbitmap_queue *sbq, unsigned int shallow_depth)

Type:int

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(hint >= depth) Then
460  hint = If depth Then prandom_u32() % depth Else 0
461  this_cpu_write( * @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  If nr == -1 Then
467  this_cpu_write( * @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  Else if nr == hint || Value for the false possibility is greater at compile time(@round_robin: Allocate bits in strict round-robin order.) Then
470  hint = nr + 1
471  If hint >= depth - 1 Then hint = 0
473  this_cpu_write( * @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  Return nr