函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:blk_throtl_bio

函数原型:bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg, struct bio *bio)

返回类型:bool

参数:

类型参数名称
struct request_queue *q
struct blkcg_gq *blkg
struct bio *bio
2164  struct throtl_qnode * qn = NULL
2165  tg等于blkg_to_tg(blkg ? : root_blkg)
2167  rw等于Return the data direction, READ or WRITE.(bio)
2168  bool throttled = false
2169  td等于 throtl_data this group belongs to
2171  WARN_ON_ONCE(!_read_lock_held() - might we be in RCU read-side critical section?* If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU* read-side critical section)
2174  如果bio_flagged(bio, BIO_THROTTLED)则转到:out
2177  如果非cgroup_subsys_on_dfl - fast test on whether a subsys is on default hierarchy*@ss: subsystem in question(io_cgrp_subsys)则
2178  lkg_rwstat_add - add a value to a blkg_rwstat*@rwstat: target blkg_rwstat*@op: REQ_OP and flags*@val: value to add* Add @val to @rwstat. The counters are chosen according to @rw. The* caller is responsible for synchronizing calls to this function.
2180  lkg_rwstat_add - add a value to a blkg_rwstat*@rwstat: target blkg_rwstat*@op: REQ_OP and flags*@val: value to add* Add @val to @rwstat. The counters are chosen according to @rw. The* caller is responsible for synchronizing calls to this function.
2183  如果非 are there any throtl rules between this group and td? [rw]则转到:out
2186  spin_lock_irq( & queue_lock)
2188  throtl_update_latency_buckets(td)
2190  blk_throtl_update_idletime(tg)
2192  sq等于 this group's service queue
2194  again :
2195  当(true)循环
2196  如果last_low_overflow_time[rw]恒等于0则last_low_overflow_time[rw]等于jiffies
2198  throtl_downgrade_check(tg)
2199  throtl_upgrade_check(tg)
2201  如果 number of queued bios [rw]则退出
2207  如果throtl_can_upgrade(td, tg)则
2209  转到:again
2211  退出
2215  throtl_charge_bio(tg, bio)
2228  Trim the used slices and adjust slice start accordingly
2235  qn等于qnode_on_parent[rw]
2236  sq等于 the parent service_queue
2237  tg等于sq_to_tg - return the throl_grp the specified service queue belongs to*@sq: the throtl_service_queue of interest* Return the throtl_grp @sq belongs to. If @sq is the top-level one* embedded in throtl_data, %NULL is returned.
2238  如果非tg则转到:out_unlock
2243  hrotl_log - log debug message via blktrace*@sq: the service_queue being reported*@fmt: printf format string*@args: printf args* The messages are prefixed with "throtl BLKG_NAME" if @sq belongs to a* throtl_grp; otherwise, just "throtl".(sq, "[%c] bio. bdisp=%llu sz=%u bps=%llu iodisp=%u iops=%u queued=%d/%d", rw == generic data direction definitions ? 'R' : 'W', Number of bytes disptached in current slice [rw], residual I/O count , tg_bps_limit(tg, rw), Number of bio's dispatched in current slice [rw], tg_iops_limit(tg, rw), number of queued bios [generic data direction definitions ], number of queued bios [WRITE])
2250  last_low_overflow_time[rw]等于jiffies
2252  Total Number of queued bios on READ and WRITE lists [rw]自加
2253  hrotl_add_bio_tg - add a bio to the specified throtl_grp*@bio: bio to add*@qn: qnode to use*@tg: the target throtl_grp* Add @bio to @tg's service_queue using @qn. If @qn is not specified,
2254  throttled = true
2262  如果flags按位与 bio_lists[] became non-empty
2263  tg_update_disptime(tg)
2264  hrotl_schedule_next_dispatch - schedule the next dispatch cycle*@sq: the service_queue to schedule dispatch for*@force: force scheduling* Arm @sq->pending_timer so that the next dispatch cycle starts on the* dispatch time of the first pending child
2267  out_unlock :
2268  spin_unlock_irq( & queue_lock)
2269  out :
2270  bio_set_flag(bio, BIO_THROTTLED)
2276  返回:throttled
调用者
名称描述
blkcg_bio_issue_check