Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__ratelimit - rate limiting*@rs: ratelimit_state data*@func: name of calling function* This enforces a rate limit: not more than @rs->burst callbacks* in every @rs->interval* RETURNS:* 0 means callbacks will be suppressed.* 1 means go ahead and do it.

Proto:int ___ratelimit(struct ratelimit_state *rs, const char *func)

Type:int

Parameter:

TypeParameterName
struct ratelimit_state *rs
const char *func
32  If Not interval Then Return 1
41  If Not raw_spin_trylock_irqsave( & protect the state , flags) Then Return 0
44  If Not begin Then begin = jiffies
47  If ime_is_before_jiffies(a) return true if a is before jiffies (begin + interval) Then
48  If missed Then
56  begin = jiffies
57  printed = 0
59  If burst && burst > printed Then
60  printed++
61  ret = 1
62  Else
63  missed++
64  ret = 0
66  raw_spin_unlock_irqrestore( & protect the state , flags)
68  Return ret
Caller
NameDescribe
__printk_ratelimit