Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-cgroup.c Create Date:2022-07-28 17:40:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lkcg_activate_policy - activate a blkcg policy on a request_queue*@q: request_queue of interest*@pol: blkcg policy to activate* Activate @pol on @q

Proto:int blkcg_activate_policy(struct request_queue *q, const struct blkcg_policy *pol)

Type:int

Parameter:

TypeParameterName
struct request_queue *q
const struct blkcg_policy *pol
1241  struct blkg_policy_data * pd_prealloc = NULL
1242  struct blkcg_gq * blkg, * pinned_blkg = NULL
1245  If blkcg_policy_enabled(q, pol) Then Return 0
1248  If queue_is_mq(q) Then blk_mq_freeze_queue(q)
1250  retry :
1251  spin_lock_irq( & queue_lock)
1257  If pd[plid] Then Continue
1261  If blkg == pinned_blkg Then
1262  pd = pd_prealloc
1263  pd_prealloc = NULL
1264  Else
1265  pd = pd_alloc_fn(GFP_NOWAIT | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success., q, blkcg)
1269  If Not pd Then
1274  If pinned_blkg Then lkg_put - put a blkg reference*@blkg: blkg to put
1276  lkg_get - get a blkg reference*@blkg: blkg to get* The caller should be holding an existing reference.
1277  pinned_blkg = blkg
1279  spin_unlock_irq( & queue_lock)
1281  If pd_prealloc Then pd_free_fn(pd_prealloc)
1283  pd_prealloc = pd_alloc_fn(GFP_KERNEL, q, blkcg)
1285  If pd_prealloc Then Go to retry
1287  Else Go to enomem
1291  pd[plid] = pd
1292  he blkg and policy id this per-policy data belongs to = blkg
1293  plid = plid
1297  If pd_init_fn Then list_for_each_entry_reverse - iterate backwards over list of given type.*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(blkg, & blkg_list, q_node)
1299  pd_init_fn(pd[plid])
1301  __set_bit - Set a bit in memory*@nr: the bit to set*@addr: the address to start counting from* Unlike set_bit(), this function is non-atomic. If it is called on the same* region of memory concurrently, the effect may be that only one operation* succeeds.
1302  ret = 0
1304  spin_unlock_irq( & queue_lock)
1305  out :
1306  If queue_is_mq(q) Then blk_mq_unfreeze_queue(q)
1308  If pinned_blkg Then lkg_put - put a blkg reference*@blkg: blkg to put
1310  If pd_prealloc Then pd_free_fn(pd_prealloc)
1312  Return ret
1314  enomem :
1316  spin_lock_irq( & queue_lock)
1318  If pd[plid] Then
1319  pd_free_fn(pd[plid])
1320  pd[plid] = NULL
1323  spin_unlock_irq( & queue_lock)
1324  ret = -ENOMEM
1325  Go to out
Caller
NameDescribe
blk_throtl_init
blk_iolatency_init
blk_iocost_init