函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bfq-iosched.c Create Date:2022-07-27 19:29:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Lifted from AS - choose which of rq1 and rq2 that is best served now.* We choose the request that is closer to the head right now. Distance* behind the head is penalized and only allowed to a certain extent.

函数原型:static struct request *bfq_choose_req(struct bfq_data *bfqd, struct request *rq1, struct request *rq2, sector_t last)

返回类型:struct request

参数:

类型参数名称
struct bfq_data *bfqd
struct request *rq1
struct request *rq2
sector_tlast
444  d1等于0, d2等于0
448  wrap等于0
450  如果非rq1rq1恒等于rq2则返回:rq2
452  如果非rq2则返回:rq1
455  如果rq_is_sync(rq1)且非rq_is_sync(rq2)则返回:rq1
457  否则如果rq_is_sync(rq2)且非rq_is_sync(rq1)则返回:rq2
459  如果 op and common flags 按位与REQ_META且非 op and common flags 按位与REQ_META的值则返回:rq1
461  否则如果 op and common flags 按位与REQ_META且非 op and common flags 按位与REQ_META的值则返回:rq2
464  s1等于lk_rq_pos() : the current sector* blk_rq_bytes() : bytes left in the entire request* blk_rq_cur_bytes() : bytes left in the current segment* blk_rq_err_bytes() : bytes left till the next error boundary* blk_rq_sectors() : sectors left in the entire
465  s2等于lk_rq_pos() : the current sector* blk_rq_bytes() : bytes left in the entire request* blk_rq_cur_bytes() : bytes left in the current segment* blk_rq_err_bytes() : bytes left till the next error boundary* blk_rq_sectors() : sectors left in the entire
470  back_max等于 maximum allowed backward seek 乘2
477  如果s1大于等于lastd1等于s1last
479  否则如果s1back_max大于等于lastd1等于lasts1的差乘 weight of backward seeks wrt forward ones
481  否则wrap或等于quest 1 wraps
484  如果s2大于等于lastd2等于s2last
486  否则如果s2back_max大于等于lastd2等于lasts2的差乘 weight of backward seeks wrt forward ones
488  否则wrap或等于quest 2 wraps
498  :wrap恒等于0
499  如果d1小于d2则返回:rq1
501  否则如果d2小于d1则返回:rq2
504  如果s1大于等于s2则返回:rq1
506  否则返回:rq2
509  :wrap恒等于quest 2 wraps
510  返回:rq1
511  :wrap恒等于quest 1 wraps
512  返回:rq2
513  :wrap恒等于quest 1 wraps 按位或quest 2 wraps
514  默认
521  如果s1小于等于s2则返回:rq1
523  否则返回:rq2
调用者
名称描述
bfq_find_next_rq
bfq_add_request
bfq_request_merged