Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bfq-iosched.c Create Date:2022-07-28 17:56:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__bfq_bfqq_recalc_budget - try to adapt the budget to the @bfqq behavior.*@bfqd: device data.*@bfqq: queue to update.*@reason: reason for expiration.* Handle the feedback on @bfqq budget at queue expiration.* See the body for detailed comments.

Proto:static void __bfq_bfqq_recalc_budget(struct bfq_data *bfqd, struct bfq_queue *bfqq, enum bfqq_expiration reason)

Type:void

Parameter:

TypeParameterName
struct bfq_data *bfqd
struct bfq_queue *bfqq
enum bfqq_expirationreason
3538  min_budget = Return min budget, which is a fraction of the current or default* max budget (trying with 1/32)
3540  If actor by which the weight of this queue is multiplied == 1 Then budget = maximum budget allowed from the feedback mechanism
3547  Else budget = 2 * min_budget
3550  bfq_log_bfqq(bfqd, bfqq, "recalc_budg: last budg %d, budg left %d", budget, used also to calculate F_i: F_i = S_i + @budget / @weight , bfq_bfqq_budget_left(bfqq))
3552  bfq_log_bfqq(bfqd, bfqq, "recalc_budg: last max_budg %d, min budg %d", budget, Return min budget, which is a fraction of the current or default* max budget (trying with 1/32))
3554  bfq_log_bfqq(bfqd, bfqq, "recalc_budg: sync %d, seeky %d", bfq_bfqq_sync(bfqq), BFQQ_SEEKY( bfq_queue in service ))
3557  If bfq_bfqq_sync(bfqq) && actor by which the weight of this queue is multiplied == 1 Then
3590  Else
3591  If budget > 5 * min_budget Then budget -= 4 * min_budget
3593  Else budget = min_budget
3596  Break
3605  Break
3606  Case reason == udget consumed
3617  Break
3652  Break
3653  Default
3654  Return
3656  Else if Not bfq_bfqq_sync(bfqq) Then
3663  budget = maximum budget allotted to a bfq_queue before rescheduling
3666  maximum budget allowed from the feedback mechanism = budget
3668  If number of budgets assigned >= Minimum number of assigned budgets for which stats are safe to compute. && Not user-configured max budget value (0 for auto-tuning) Then maximum budget allowed from the feedback mechanism = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(maximum budget allowed from the feedback mechanism , maximum budget allotted to a bfq_queue before rescheduling )
3682  next_rq = fifo isn't expired, next request to serve
3683  If next_rq Then budget, used also to calculate F_i: F_i = S_i + @budget / @weight = max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedlong, maximum budget allowed from the feedback mechanism , see the definition of bfq_async_charge_factor for details )
3687  bfq_log_bfqq(bfqd, bfqq, "head sect: %u, new budget %d", next_rq ? blk_rq_sectors(next_rq) : 0, budget, used also to calculate F_i: F_i = S_i + @budget / @weight )
Caller
NameDescribe
bfq_bfqq_expireq_bfqq_expire - expire a queue.*@bfqd: device owning the queue.*@bfqq: the queue to expire.*@compensate: if true, compensate for the time spent idling.*@reason: the reason causing the expiration.* If the process associated with bfqq does slow I/O (e