函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ioc_rqos_throttle

函数原型:static void ioc_rqos_throttle(struct rq_qos *rqos, struct bio *bio)

返回类型:void

参数:

类型参数名称
struct rq_qos *rqos
struct bio *bio
1681  blkg等于* Represents the association of the css and request_queue for the bio. * If a bio goes direct to device, it will not have a blkg as it will * not have a request_queue associated with it. The reference is put * on release of the bio.
1682  ioc等于accessors and helpers
1683  iocg等于blkg_to_iocg(blkg)
1690  如果非enabled或非 this iocg's depth in the hierarchy and ancestors including self 则返回
1694  如果非iocg_activate(iocg, & now)则返回
1698  abs_cost等于calc_vtime_cost(bio, iocg, false)
1699  如果非abs_cost则返回
1702  to detect randio 等于bio_end_sector(bio)
1704  vtime等于atomic64_read( & * `vtime` is this iocg's vtime cursor which progresses as IOs are * issued. If lagging behind device vtime, the delta represents * the currently available IO budget. If runnning ahead, the * overage. * `vtime_done` is the same but progressed on completion )
1705  current_hweight(iocg, & hw_active, & hw_inuse)
1707  如果hw_inuse小于hw_activetime_after_eq64(vtime + inuse_margin_vtime, vnow)则
1709  TRACE_IOCG_PATH(inuse_reset, iocg, & now, inuse, weight, hw_inuse, hw_active)
1711  spin_lock_irq( & lock)
1712  propagate_active_weight(iocg, weight, weight)
1713  spin_unlock_irq( & lock)
1714  current_hweight(iocg, & hw_active, & hw_inuse)
1717  cost等于Scale @abs_cost to the inverse of @hw_inuse. The lower the hierarchical* weight, the more expensive each IO. Must round up.
1724  如果非waitqueue_active -- locklessly test for waiters on the queue*@wq_head: the waitqueue to test for waiters* returns true if the wait list is not empty* NOTE: this function is lockless and requires care, incorrect usage _will_且非atomic64_read( & abs_vdebt)且time_before_eq64(vtime + cost, vnow)则
1727  iocg_commit_bio(iocg, bio, cost)
1728  返回
1741  如果_issue_as_root_blkg - see if this bio needs to be issued as root blkg*@return: true if this bio needs to be submitted with the root blkg contextfatal_signal_pending(当前进程)则
1742  atomic64_add(abs_cost, & abs_vdebt)
1743  如果iocg_kick_delay(iocg, & now, cost)则lkcg_schedule_throttle - this task needs to check for throttling*@q: the request queue IO was submitted on*@use_memdelay: do we charge this to memory delay for PSI* This is called by the IO controller when we know there's delay accumulated
1746  返回
1762  spin_lock_irq( & lock)
1770  如果此条件成立可能性小(为编译器优化)(链表为空)则
1771  spin_unlock_irq( & lock)
1772  iocg_commit_bio(iocg, bio, cost)
1773  返回
1776  init_waitqueue_func_entry( & wait, iocg_wake_fn)
1777  private等于当前进程
1778  bio等于bio
1779  abs_cost等于abs_cost
1780  committed = false
1782  __add_wait_queue_entry_tail( & waitq, & wait)
1783  iocg_kick_waitq(iocg, & now)
1785  spin_unlock_irq( & lock)
1787  当(true)循环
1788  set_current_state(深度睡眠态)
1789  如果committed退出
1791  io_schedule()
1795  sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.