| Function report | 
| Source Code: block\blk-iocost.c | Create Date:2022-07-28 17:48:33 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:ioc_timer_fn
Proto:static void ioc_timer_fn(struct timer_list *timer)
Type:void
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct timer_list * | timer | 
| 1346 | nr_surpluses = 0 , nr_shortages = 0 , nr_lagging = 0 | 
| 1354 | ioc_lat_stat(ioc, missed_ppm, & rq_wait_pct) | 
| 1357 | spin_lock_irq( & lock) | 
| 1361 | period_vtime = vnow - vtime starttime | 
| 1362 | If WARN_ON_ONCE(!period_vtime) Then | 
| 1363 | spin_unlock_irq( & lock) | 
| 1364 | Return | 
| 1383 | iocg_kick_waitq(iocg, & now) | 
| 1384 | iocg_kick_delay(iocg, & now, 0) | 
| 1385 | Else if was iocg idle this period? Then | 
| 1387 | last_inuse = inuse | 
| 1392 | spin_unlock( & lock) | 
| 1394 | commit_active_weights(ioc) | 
| 1405 | vdone = atomic64_read( & done_vtime) | 
| 1407 | current_hweight(iocg, & hw_active, & hw_inuse) | 
| 1425 | Else if time_before64(last_vtime, vtime) Then vusage = vtime - last_vtime | 
| 1427 | Else vusage = 0 | 
| 1430 | last_vtime += vusage | 
| 1436 | vusage = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(vusage, vtime - vdone) | 
| 1439 | If vusage Then | 
| 1440 | usage = DIV64_U64_ROUND_UP(vusage * hw_inuse, period_vtime) | 
| 1444 | Else | 
| 1445 | usage = 0 | 
| 1452 | has_surplus = false | 
| 1460 | atomic64_add(delta, & done_vtime) | 
| 1461 | last_vtime += delta | 
| 1464 | has_surplus = true | 
| 1465 | nr_surpluses++ | 
| 1473 | Else | 
| 1490 | Else | 
| 1492 | nr_shortages++ | 
| 1496 | If Not nr_shortages || Not nr_surpluses Then Go to skip_surplus_transfers | 
| 1502 | nr_valid = 0 | 
| 1504 | If Not has_surplus Then Continue | 
| 1508 | When i < NR_USAGE_SLOTS cycle | 
| 1514 | If nr_valid < MIN_VALID_USAGES Then Continue | 
| 1517 | current_hweight(iocg, & hw_active, & hw_inuse) | 
| 1519 | If Not new_hwi Then Continue | 
| 1525 | TRACE_IOCG_PATH(inuse_giveaway, iocg, & now, inuse, new_inuse, hw_inuse, new_hwi) | 
| 1531 | skip_surplus_transfers : | 
| 1532 | commit_active_weights(ioc) | 
| 1541 | If rq_wait_pct > RQ_WAIT_BUSY_PCT || missed_ppm[generic data direction definitions ] > ppm_rthr || missed_ppm[WRITE] > ppm_wthr Then | 
| 1544 | saturation history = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(saturation history , 0) | 
| 1545 | saturation history ++ | 
| 1546 | Else if rq_wait_pct <= RQ_WAIT_BUSY_PCT * UNBUSY_THR_PCT / 100 && missed_ppm[generic data direction definitions ] <= ppm_rthr * UNBUSY_THR_PCT / 100 && missed_ppm[WRITE] <= ppm_wthr * UNBUSY_THR_PCT / 100 Then | 
| 1550 | If nr_shortages && Not nr_lagging Then | 
| 1556 | Else | 
| 1557 | saturation history = 0 | 
| 1562 | If saturation history > 0 || saturation history < 0 && Not nr_lagging Then | 
| 1563 | vrate = atomic64_read( & vtime_rate) | 
| 1567 | If rq_wait_pct > RQ_WAIT_BUSY_PCT Then vrate_min = VRATE_MIN | 
| 1583 | Else | 
| 1586 | adj_pct = vrate adjust percentages indexed by ioc->busy_level. We adjust up on* vtime credit shortage and down on device saturation.[idx] | 
| 1588 | If saturation history > 0 Then adj_pct = 100 - adj_pct | 
| 1597 | trace_iocost_ioc_vrate_adj(ioc, vrate, & missed_ppm, rq_wait_pct, nr_lagging, nr_shortages, nr_surpluses) | 
| 1601 | atomic64_set( & vtime_rate, vrate) | 
| 1602 | inuse_margin_vtime = DIV64_U64_ROUND_UP(period_us * vrate * INUSE_MARGIN_PCT, 100) | 
| 1604 | Else if saturation history != prev_busy_level || nr_lagging Then | 
| 1610 | ioc_refresh_params(ioc, false) | 
| 1616 | atomic64_inc( & c'd each period ) | 
| 1619 | If Not list_empty - tests whether a list is empty*@head: the list to test. Then | 
| 1620 | ioc_start_period(ioc, & now) | 
| 1621 | Else | 
| 1622 | saturation history = 0 | 
| 1627 | spin_unlock_irq( & lock) | 
| 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 |