Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blkcg_print_stat

Proto:static int blkcg_print_stat(struct seq_file *sf, void *v)

Type:int

Parameter:

TypeParameterName
struct seq_file *sf
void *v
744  blkcg = css_to_blkcg(seq_css(sf))
747  group_rstat_flush - flush stats in @cgrp's subtree*@cgrp: target cgroup* Collect all per-cpu stats in @cgrp's subtree into the global counters* and propagate them upwards
748  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
751  bis = iostat
755  size = seq_get_buf - get buffer to write arbitrary data to*@m: the seq_file handle*@bufp: the beginning of the buffer is stored here* Return the number of bytes available in the buffer, or zero if* there's no space. , off = 0
757  bool has_stats = false
760  spin_lock_irq( & queue_lock)
762  If Not is this blkg online? protected by both blkcg and q locks Then Go to skip
765  dname = blkg_dev_name(blkg)
766  If Not dname Then Go to skip
775  off += scnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
777  Do
778  seq = u64_stats_fetch_begin( & sync)
780  rbytes = bytes[BLKG_IOSTAT_READ]
781  wbytes = bytes[BLKG_IOSTAT_WRITE]
782  dbytes = bytes[BLKG_IOSTAT_DISCARD]
783  rios = ios[BLKG_IOSTAT_READ]
784  wios = ios[BLKG_IOSTAT_WRITE]
785  dios = ios[BLKG_IOSTAT_DISCARD]
786  When u64_stats_fetch_retry( & sync, seq) cycle
788  If rbytes || wbytes || rios || wios Then
789  has_stats = true
790  off += scnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
796  If blkcg_debug_stats && atomic_read( & use_delay) Then
797  has_stats = true
798  off += scnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
804  When i < Maximum number of blkcg policies allowed to be registered concurrently.* Defined here to simplify include dependency. cycle
805  pol = blkcg_policy[i]
808  If Not pd[i] || Not pd_stat_fn Then Continue
811  written = pd_stat_fn(pd[i], buf + off, size - off)
812  If written Then has_stats = true
814  off += written
817  If has_stats Then
818  If off < size - 1 Then
821  Else
825  :
826  spin_unlock_irq( & queue_lock)
829  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
830  Return 0