From: Andrea Righi <righi.andrea@gmail.com>
To: akpm@linux-foundation.org, balbir@linux.vnet.ibm.com
Cc: Matt Heaton <matt@bluehost.com>, Mark Seger <Mark.Seger@hp.com>,
Oleg Nesterov <oleg@tv-sign.ru>,
linux-kernel@vger.kernel.org,
Andrea Righi <righi.andrea@gmail.com>
Subject: [PATCH -mm 1/4] documentation of /proc/<pid>/blockio and /proc/<pid>/task/<tid>/blockio
Date: Fri, 1 Aug 2008 00:49:56 +0200 [thread overview]
Message-ID: <1217544599-8935-2-git-send-email-righi.andrea@gmail.com> (raw)
In-Reply-To: <>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2827 bytes --]
Provide the documentation about the kernel->userspace interface to show
task/thread/block device IO statistics.
Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
---
Documentation/filesystems/proc.txt | 43 ++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 6455782..55f425f 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -44,6 +44,7 @@ Table of Contents
2.14 /proc/<pid>/io - Display the IO accounting fields
2.15 /proc/<pid>/coredump_filter - Core dump filtering settings
2.16 /proc/<pid>/mountinfo - Information about mounts
+ 2.17 /proc/<pid>/blockio - Display per block device IO statistics
------------------------------------------------------------------------------
Preface
@@ -2451,3 +2452,45 @@ For more information on mount propagation see:
Documentation/filesystems/sharedsubtree.txt
------------------------------------------------------------------------------
+
+2.17 /proc/<pid>/blockio - Display per block device IO statistics
+--------------------------------------------------------------------
+
+This file provides process IO statistics separated per block device, running
+thread and exited children.
+
+IO statistics are reported in the following form:
+
+$ cat /proc/<pid>/blockio
+3609 t 3,1 331776 0 0
+3609 c 3,1 25677824 33513472 0
+3609 c 3,5 54658560 66994176 0
+(1) (2)(3) (4) (5) (6)
+
+(1) thread id (tid)
+(2) type: "t" identifies the specific thread IO statistics, "c" identifies the
+ IO statistics of all the exited children
+(3) device: the specific block device the IO statistics refer to, reported in
+ the form major,minor (device numbers)
+(4) read_bytes: IO counter of bytes read (see §2.14)
+(4) write_bytes: IO counter of bytes written (see §2.14)
+(5) cancelled_write_bytes: IO counter of truncated bytes (see §2.14)
+
+As a simple example it is possible to quickly retrieve the list of the top IO
+consumers on /dev/hda1 as following:
+
+$ cat /proc/[0-9]*/blockio | sed -ne "s/^\(.*\)` \
+stat /dev/hda1 | sed -ne 's/.*type: \(.*\)$/\1/p' \
+` \([0-9]\+\) \([0-9]\+\) \([0-9]\+\)$/echo \1\$((\2 + \3 + \4))/p" | \
+sh | sort -nrt' ' -k3
+
+Looking at the type of statistic it is also possible to know if the top IO
+consumer spawned many children (c) that did the real IO work or if it is
+currently doing the work (t).
+
+Distinct thread IO statistics are provided by /proc/<pid>/task/<tid>/blockio.
+This file only reports the specific thread IO, excluding the statistics of the
+exited children and the other running threads belonging to the same thread
+group.
+
+------------------------------------------------------------------------------
--
1.5.4.3
reply other threads:[~2008-07-31 22:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1217544599-8935-2-git-send-email-righi.andrea@gmail.com \
--to=righi.andrea@gmail.com \
--cc=Mark.Seger@hp.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@bluehost.com \
--cc=oleg@tv-sign.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®