函数逻辑报告 |
Source Code:block\blk-iocost.c |
Create Date:2022-07-27 19:24:19 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:ioc_timer_fn
函数原型:static void ioc_timer_fn(struct timer_list *timer)
返回类型:void
参数:
类型 | 参数 | 名称 |
---|---|---|
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 | 如果WARN_ON_ONCE(!period_vtime)则 |
1363 | spin_unlock_irq( & lock) |
1364 | 返回 |
1378 | 加自旋锁 |
1383 | iocg_kick_waitq(iocg, & now) |
1384 | iocg_kick_delay(iocg, & now, 0) |
1385 | 否则如果was iocg idle this period? 则 |
1387 | last_inuse等于inuse |
1389 | 删除链表项并重新初始化 |
1392 | 自旋锁解锁 |
1394 | commit_active_weights(ioc) |
1405 | vdone等于atomic64_read( & done_vtime) |
1407 | current_hweight(iocg, & hw_active, & hw_inuse) |
1425 | 否则如果time_before64(last_vtime, vtime)则vusage等于vtime减last_vtime |
1427 | 否则vusage等于0 |
1430 | last_vtime加等于vusage |
1439 | 如果vusage则 |
1440 | usage等于DIV64_U64_ROUND_UP(vusage * hw_inuse, period_vtime) |
1444 | 否则 |
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 | 否则 |
1474 | new_hwi等于两数取大(hw_inuse, usage * SURPLUS_SCALE_PCT / 100 + SURPLUS_SCALE_ABS) |
1490 | 否则 |
1492 | nr_shortages自加 |
1496 | 如果非nr_shortages或非nr_surpluses则转到:skip_surplus_transfers |
1502 | nr_valid等于0 |
1504 | 如果非has_surplus则继续下一循环 |
1508 | 以i小于NR_USAGE_SLOTS循环 |
1514 | 如果nr_valid小于MIN_VALID_USAGES则继续下一循环 |
1517 | current_hweight(iocg, & hw_active, & hw_inuse) |
1519 | 如果非new_hwi则继续下一循环 |
1525 | TRACE_IOCG_PATH(inuse_giveaway, iocg, & now, inuse, new_inuse, hw_inuse, new_hwi) |
1531 | skip_surplus_transfers : |
1532 | commit_active_weights(ioc) |
1544 | saturation history 等于两数取大(saturation history , 0) |
1545 | saturation history 自加 |
1546 | 否则如果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则 |
1550 | 如果nr_shortages且非nr_lagging则 |
1551 | saturation history 等于两数取小(saturation history , 0) |
1553 | 如果非nr_surpluses则saturation history 自减 |
1556 | 否则 |
1557 | saturation history 等于0 |
1562 | 如果saturation history 大于0或saturation history 小于0且非nr_lagging则 |
1563 | vrate等于atomic64_read( & vtime_rate) |
1567 | 如果rq_wait_pct大于RQ_WAIT_BUSY_PCT则vrate_min等于VRATE_MIN |
1583 | 否则 |
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 | 如果saturation history 大于0则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 | 否则如果saturation history 不等于prev_busy_level或nr_lagging则 |
1610 | ioc_refresh_params(ioc, false) |
1616 | atomic64_inc( & c'd each period ) |
1627 | spin_unlock_irq( & lock) |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |