Function report |
Source Code:block\blk-iocost.c |
Create Date:2022-07-28 17:48:41 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:calc_vtime_cost_builtin
Proto:static void calc_vtime_cost_builtin(struct bio *bio, struct ioc_gq *iocg, bool is_merge, u64 *costp)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct bio * | bio | |
| struct ioc_gq * | iocg | |
| bool | is_merge | |
| u64 * | costp |
| 1635 | pages = max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, bio_sectors(bio) >> IOC_SECT_TO_PAGE_SHIFT, 1) |
| 1636 | seek_pages = 0 |
| 1637 | cost = 0 |
| 1640 | Case bio_op(bio) == REQ_OP_READ |
| 1641 | coef_seqio = lcoefs[LCOEF_RSEQIO] |
| 1642 | coef_randio = lcoefs[LCOEF_RRANDIO] |
| 1643 | coef_page = lcoefs[LCOEF_RPAGE] |
| 1644 | Break |
| 1645 | Case bio_op(bio) == REQ_OP_WRITE |
| 1646 | coef_seqio = lcoefs[LCOEF_WSEQIO] |
| 1647 | coef_randio = lcoefs[LCOEF_WRANDIO] |
| 1648 | coef_page = lcoefs[LCOEF_WPAGE] |
| 1649 | Break |
| 1650 | Default |
| 1651 | Go to out |
| 1654 | If to detect randio Then |
| 1656 | seek_pages >>= IOC_SECT_TO_PAGE_SHIFT |
| 1659 | If Not is_merge Then |
| 1660 | If seek_pages > LCOEF_RANDIO_PAGES Then |
| 1661 | cost += coef_randio |
| 1662 | Else |
| 1663 | cost += coef_seqio |
| 1667 | out : |
| Name | Describe |
|---|---|
| calc_vtime_cost |
| 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 |