Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blk_throtl_init

Proto:int blk_throtl_init(struct request_queue *q)

Type:int

Parameter:

TypeParameterName
struct request_queue *q
2429  td = kzalloc_node - allocate zeroed memory from a particular memory node.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@node: memory node from which to allocate
2430  If Not td Then Return -ENOMEM
2432  latency_buckets[generic data direction definitions ] = allocate one copy of the object for every present
2434  If Not latency_buckets[generic data direction definitions ] Then
2435  kfree(td)
2436  Return -ENOMEM
2438  latency_buckets[WRITE] = allocate one copy of the object for every present
2440  If Not latency_buckets[WRITE] Then
2441  free previously allocated percpu memory
2442  kfree(td)
2443  Return -ENOMEM
2446  INIT_WORK( & Work for dispatching throttled bios , lk_throtl_dispatch_work_fn - work function for throtl_data->dispatch_work*@work: work item being executed* This function is queued for execution when bio's reach the bio_lists[]* of throtl_data->service_queue. Those bio's are ready and issued by this)
2447  a service_queue, assumes the caller zeroed it
2449  Throttle data = td
2450  queue = q
2452  limit_valid[LIMIT_MAX] = true
2453  limit_index = LIMIT_MAX
2454  low_upgrade_time = jiffies
2455  low_downgrade_time = jiffies
2458  ret = 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
2459  If ret Then
2460  free previously allocated percpu memory
2461  free previously allocated percpu memory
2462  kfree(td)
2464  Return ret