<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Block layer statistics in /sys/block/<dev>/stat — The Linux Kernel documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=3918102e" />
<script src="../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../_static/doctools.js?v=9bcbadda"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Switching Scheduler" href="switching-sched.html" />
<link rel="prev" title="Block layer support for Persistent Reservations" href="pr.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/logo.svg" alt="Logo of The Linux Kernel"/>
</a></p>
<h1 class="logo"><a href="../index.html">The Linux Kernel</a></h1>
<p class="blurb">6.18.50</p>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>
<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#human-interfaces">Human interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#networking-interfaces">Networking interfaces</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../subsystem-apis.html#storage-interfaces">Storage interfaces</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../filesystems/index.html">Filesystems in the Linux kernel</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="index.html">Block</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cdrom/index.html">CD-ROM</a></li>
<li class="toctree-l3"><a class="reference internal" href="../scsi/index.html">SCSI Subsystem</a></li>
<li class="toctree-l3"><a class="reference internal" href="../target/index.html">TCM Virtual Device</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nvme/index.html">NVMe Subsystem</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a></li>
</ul>
</div>
<script type="text/javascript"> <!--
var sbar = document.getElementsByClassName("sphinxsidebar")[0];
let currents = document.getElementsByClassName("current")
if (currents.length) {
sbar.scrollTop = currents[currents.length - 1].offsetTop;
}
--> </script>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/block/stat.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="block-layer-statistics-in-sys-block-dev-stat">
<h1>Block layer statistics in /sys/block/<dev>/stat<a class="headerlink" href="#block-layer-statistics-in-sys-block-dev-stat" title="Link to this heading">¶</a></h1>
<p>This file documents the contents of the /sys/block/<dev>/stat file.</p>
<p>The stat file provides several statistics about the state of block
device <dev>.</p>
<ol class="upperalpha simple" start="17">
<li><p>Why are there multiple statistics in a single file? Doesn’t sysfs
normally contain a single value per file?</p></li>
</ol>
<ol class="upperalpha simple">
<li><p>By having a single file, the kernel can guarantee that the statistics
represent a consistent snapshot of the state of the device. If the
statistics were exported as multiple files containing one statistic
each, it would be impossible to guarantee that a set of readings
represent a single point in time.</p></li>
</ol>
<p>The stat file consists of a single line of text containing 17 decimal
values separated by whitespace. The fields are summarized in the
following table, and described in more detail below.</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Name</p></th>
<th class="head"><p>units</p></th>
<th class="head"><p>description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>read I/Os</p></td>
<td><p>requests</p></td>
<td><p>number of read I/Os processed</p></td>
</tr>
<tr class="row-odd"><td><p>read merges</p></td>
<td><p>requests</p></td>
<td><p>number of read I/Os merged with in-queue I/O</p></td>
</tr>
<tr class="row-even"><td><p>read sectors</p></td>
<td><p>sectors</p></td>
<td><p>number of sectors read</p></td>
</tr>
<tr class="row-odd"><td><p>read ticks</p></td>
<td><p>milliseconds</p></td>
<td><p>total wait time for read requests</p></td>
</tr>
<tr class="row-even"><td><p>write I/Os</p></td>
<td><p>requests</p></td>
<td><p>number of write I/Os processed</p></td>
</tr>
<tr class="row-odd"><td><p>write merges</p></td>
<td><p>requests</p></td>
<td><p>number of write I/Os merged with in-queue I/O</p></td>
</tr>
<tr class="row-even"><td><p>write sectors</p></td>
<td><p>sectors</p></td>
<td><p>number of sectors written</p></td>
</tr>
<tr class="row-odd"><td><p>write ticks</p></td>
<td><p>milliseconds</p></td>
<td><p>total wait time for write requests</p></td>
</tr>
<tr class="row-even"><td><p>in_flight</p></td>
<td><p>requests</p></td>
<td><p>number of I/Os currently in flight</p></td>
</tr>
<tr class="row-odd"><td><p>io_ticks</p></td>
<td><p>milliseconds</p></td>
<td><p>total time this block device has been active</p></td>
</tr>
<tr class="row-even"><td><p>time_in_queue</p></td>
<td><p>milliseconds</p></td>
<td><p>total wait time for all requests</p></td>
</tr>
<tr class="row-odd"><td><p>discard I/Os</p></td>
<td><p>requests</p></td>
<td><p>number of discard I/Os processed</p></td>
</tr>
<tr class="row-even"><td><p>discard merges</p></td>
<td><p>requests</p></td>
<td><p>number of discard I/Os merged with in-queue I/O</p></td>
</tr>
<tr class="row-odd"><td><p>discard sectors</p></td>
<td><p>sectors</p></td>
<td><p>number of sectors discarded</p></td>
</tr>
<tr class="row-even"><td><p>discard ticks</p></td>
<td><p>milliseconds</p></td>
<td><p>total wait time for discard requests</p></td>
</tr>
<tr class="row-odd"><td><p>flush I/Os</p></td>
<td><p>requests</p></td>
<td><p>number of flush I/Os processed</p></td>
</tr>
<tr class="row-even"><td><p>flush ticks</p></td>
<td><p>milliseconds</p></td>
<td><p>total wait time for flush requests</p></td>
</tr>
</tbody>
</table>
<section id="read-i-os-write-i-os-discard-i-0s">
<h2>read I/Os, write I/Os, discard I/0s<a class="headerlink" href="#read-i-os-write-i-os-discard-i-0s" title="Link to this heading">¶</a></h2>
<p>These values increment when an I/O request completes.</p>
</section>
<section id="flush-i-os">
<h2>flush I/Os<a class="headerlink" href="#flush-i-os" title="Link to this heading">¶</a></h2>
<p>These values increment when an flush I/O request completes.</p>
<p>Block layer combines flush requests and executes at most one at a time.
This counts flush requests executed by disk. Not tracked for partitions.</p>
</section>
<section id="read-merges-write-merges-discard-merges">
<h2>read merges, write merges, discard merges<a class="headerlink" href="#read-merges-write-merges-discard-merges" title="Link to this heading">¶</a></h2>
<p>These values increment when an I/O request is merged with an
already-queued I/O request.</p>
</section>
<section id="read-sectors-write-sectors-discard-sectors">
<h2>read sectors, write sectors, discard_sectors<a class="headerlink" href="#read-sectors-write-sectors-discard-sectors" title="Link to this heading">¶</a></h2>
<p>These values count the number of sectors read from, written to, or
discarded from this block device. The “sectors” in question are the
standard UNIX 512-byte sectors, not any device- or filesystem-specific
block size. The counters are incremented when the I/O completes.</p>
</section>
<section id="read-ticks-write-ticks-discard-ticks-flush-ticks">
<h2>read ticks, write ticks, discard ticks, flush ticks<a class="headerlink" href="#read-ticks-write-ticks-discard-ticks-flush-ticks" title="Link to this heading">¶</a></h2>
<p>These values count the number of milliseconds that I/O requests have
waited on this block device. If there are multiple I/O requests waiting,
these values will increase at a rate greater than 1000/second; for
example, if 60 read requests wait for an average of 30 ms, the read_ticks
field will increase by 60*30 = 1800.</p>
</section>
<section id="in-flight">
<h2>in_flight<a class="headerlink" href="#in-flight" title="Link to this heading">¶</a></h2>
<p>This value counts the number of I/O requests that have been issued to
the device driver but have not yet completed. It does not include I/O
requests that are in the queue but not yet issued to the device driver.</p>
</section>
<section id="io-ticks">
<h2>io_ticks<a class="headerlink" href="#io-ticks" title="Link to this heading">¶</a></h2>
<p>This value counts the number of milliseconds during which the device has
had I/O requests queued.</p>
</section>
<section id="time-in-queue">
<h2>time_in_queue<a class="headerlink" href="#time-in-queue" title="Link to this heading">¶</a></h2>
<p>This value counts the number of milliseconds that I/O requests have waited
on this block device. If there are multiple I/O requests waiting, this
value will increase as the product of the number of milliseconds times the
number of requests waiting (see “read ticks” above for an example).</p>
</section>
</section>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©The kernel development community.
|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
& <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
|
<a href="../_sources/block/stat.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>