| Function report | 
| 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 activity | Download SCCT | Chinese | 
Name:blk_iocost_init
Proto:static int blk_iocost_init(struct request_queue *q)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| 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). | 
| 1921 | pcpu_stat = alloc_percpu(structioc_pcpu_stat) | 
| 1922 | If Not pcpu_stat Then | 
| 1928 | id = RQ_QOS_COST | 
| 1929 | ops = ioc_rqos_ops | 
| 1932 | Process spin lock initialization( & lock) | 
| 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) | 
| 1954 | Return ret | 
| 1956 | Return 0 | 
| Name | Describe | 
|---|---|
| ioc_qos_write | |
| ioc_cost_model_write | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |