函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:This is called when we want to actually walk up the hierarchy and check to* see if we need to throttle, and then actually throttle if there is some* accumulated delay. This should only be called upon return to user space so

函数原型:static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay)

返回类型:void

参数:

类型参数名称
struct blkcg_gq *blkg
booluse_memdelay
1569  now等于Convert ktime_t to nanoseconds
1571  delay_nsec等于0
1574  all non-root blkcg_gq's are guaranteed to have access to parent 循环
1575  如果atomic_read( & use_delay)则
1580  blkg等于 all non-root blkcg_gq's are guaranteed to have access to parent
1583  如果非delay_nsec则返回
1593  delay_nsec等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u64, delay_nsec, 250 * NSEC_PER_MSEC)
1595  如果use_memdelaypsi_memstall_enter - mark the beginning of a memory stall section*@flags: flags to handle nested sections* Marks the calling task as being stalled due to a lack of memory,* such as waiting for a refault or performing reclaim.
1598  exp等于Add a ktime_t variable and a scalar nanosecond value.* res = kt + nsval:(now, delay_nsec)
1599  tok等于io_schedule_prepare()
1600  循环
1601  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (Convenience macros for the sake of set_current_state: )
1602  如果非schedule_hrtimeout - sleep until timeout*@expires: timeout value (ktime_t)*@mode: timer mode* Make the current task sleep until the given expiry time has* elapsed. The routine will return immediately unless退出
1604  当非fatal_signal_pending(当前进程)循环
1605  io_schedule_finish(tok)
1607  如果use_memdelaypsi_memstall_leave - mark the end of an memory stall section*@flags: flags to handle nested memdelay sections* Marks the calling task as no longer stalled due to lack of memory.
调用者
名称描述
blkcg_maybe_throttle_currentlkcg_maybe_throttle_current - throttle the current task if it has been marked* This is only called if we've been marked with set_notify_resume()