Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blk_iocost_init

Proto:static int blk_iocost_init(struct request_queue *q)

Type:int

Parameter:

TypeParameterName
struct request_queue *q
1917  ioc = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
1918  If Not ioc Then Return -ENOMEM
1921  pcpu_stat = alloc_percpu(structioc_pcpu_stat)
1922  If Not pcpu_stat Then
1923  kfree(ioc)
1924  Return -ENOMEM
1927  rqos = rqos
1928  id = RQ_QOS_COST
1929  ops = ioc_rqos_ops
1930  q = q
1932  Process spin lock initialization( & lock)
1933  imer_setup - prepare a timer for first use*@timer: the timer in question*@callback: the function to call when timer expires*@flags: any TIMER_* flags* Regular timer initialization should use either DEFINE_TIMER() above,* or timer_setup()( & timer, ioc_timer_fn, 0)
1934  Initialization list head
1936  running = IOC_IDLE
1937  atomic64_set( & vtime_rate, VTIME_PER_USEC)
1938  seqcount_init( & period_seqcount)
1939  wallclock starttime = ktime_to_us(ktime_get())
1940  atomic64_set( & c'd each period , 0)
1941  atomic_set( & r lazy hweights , 0)
1943  spin_lock_irq( & lock)
1944  autop_idx = AUTOP_INVALID
1945  ioc_refresh_params(ioc, true)
1946  spin_unlock_irq( & lock)
1948  rq_qos_add(q, rqos)
1949  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
1950  If ret Then
1951  rq_qos_del(q, rqos)
1952  free previously allocated percpu memory
1953  kfree(ioc)
1954  Return ret
1956  Return 0
Caller
NameDescribe
ioc_qos_write
ioc_cost_model_write