lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200612081152.kB8BqXLA019780@shell0.pdx.osdl.net>
Date:	Fri, 08 Dec 2006 03:52:33 -0800
From:	akpm@...l.org
To:	linux-kernel@...r.kernel.org
Cc:	akpm@...l.org, balbir@...ibm.com, csturtiv@....com, daw@....com,
	guillaume.thouvenin@...l.net, jlan@....com, nagar@...son.ibm.com,
	tee@....com
Subject: [patch 11/13] io-accounting: via taskstats

From: Andrew Morton <akpm@...l.org>

Deliver IO accounting via taskstats.

Cc: Jay Lan <jlan@....com>
Cc: Shailabh Nagar <nagar@...son.ibm.com>
Cc: Balbir Singh <balbir@...ibm.com>
Cc: Chris Sturtivant <csturtiv@....com>
Cc: Tony Ernst <tee@....com>
Cc: Guillaume Thouvenin <guillaume.thouvenin@...l.net>
Cc: David Wright <daw@....com>
Signed-off-by: Andrew Morton <akpm@...l.org>
---

 include/linux/taskstats.h |    8 +++++++-
 kernel/tsacct.c           |    9 +++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff -puN include/linux/taskstats.h~io-accounting-via-taskstats include/linux/taskstats.h
--- a/include/linux/taskstats.h~io-accounting-via-taskstats
+++ a/include/linux/taskstats.h
@@ -31,7 +31,7 @@
  */
 
 
-#define TASKSTATS_VERSION	2
+#define TASKSTATS_VERSION	3
 #define TS_COMM_LEN		32	/* should be >= TASK_COMM_LEN
 					 * in linux/sched.h */
 
@@ -140,6 +140,12 @@ struct taskstats {
 	__u64	read_syscalls;		/* read syscalls */
 	__u64	write_syscalls;		/* write syscalls */
 	/* Extended accounting fields end */
+
+#define TASKSTATS_HAS_IO_ACCOUNTING
+	/* Per-task storage I/O accounting starts */
+	__u64	read_bytes;		/* bytes of read I/O */
+	__u64	write_bytes;		/* bytes of write I/O */
+	__u64	cancelled_write_bytes;	/* bytes of cancelled write I/O */
 };
 
 
diff -puN kernel/tsacct.c~io-accounting-via-taskstats kernel/tsacct.c
--- a/kernel/tsacct.c~io-accounting-via-taskstats
+++ a/kernel/tsacct.c
@@ -96,6 +96,15 @@ void xacct_add_tsk(struct taskstats *sta
 	stats->write_char	= p->wchar;
 	stats->read_syscalls	= p->syscr;
 	stats->write_syscalls	= p->syscw;
+#ifdef CONFIG_TASK_IO_ACCOUNTING
+	stats->read_bytes	= p->ioac.read_bytes;
+	stats->write_bytes	= p->ioac.write_bytes;
+	stats->cancelled_write_bytes = p->ioac.cancelled_write_bytes;
+#else
+	stats->read_bytes	= 0;
+	stats->write_bytes	= 0;
+	stats->cancelled_write_bytes = 0;
+#endif
 }
 #undef KB
 #undef MB
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ