Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blk_throtl_bio

Proto:bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg, struct bio *bio)

Type:bool

Parameter:

TypeParameterName
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  If bio_flagged(bio, BIO_THROTTLED) Then Go to out
2177  If Not cgroup_subsys_on_dfl - fast test on whether a subsys is on default hierarchy*@ss: subsystem in question(io_cgrp_subsys) Then
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  If Not are there any throtl rules between this group and td? [rw] Then Go to 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  When (true) cycle
2196  If last_low_overflow_time[rw] == 0 Then last_low_overflow_time[rw] = jiffies
2198  throtl_downgrade_check(tg)
2199  throtl_upgrade_check(tg)
2201  If number of queued bios [rw] Then Break
2207  If throtl_can_upgrade(td, tg) Then
2209  Go to again
2211  Break
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  If Not tg Then Go to 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  If flags & bio_lists[] became non-empty Then
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  Return throttled
Caller
NameDescribe
blkcg_bio_issue_check