Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbYIQLIG (ORCPT ); Wed, 17 Sep 2008 07:08:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754445AbYIQLGS (ORCPT ); Wed, 17 Sep 2008 07:06:18 -0400 Received: from qb-out-0506.google.com ([72.14.204.228]:29149 "EHLO qb-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754365AbYIQLGQ (ORCPT ); Wed, 17 Sep 2008 07:06:16 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Ntkao2QD6F5mUPeqiuV564d8yOXygehfP8NADvjVxFCpjJ1jePrvqd0TaKuYnErId9 FrZTe9yUNT4ZoxMxJd6RUQ0n1p4VaJHr8sNveW9+FXre7HEqBVRx4MJ+wDiz4/UlJ65K jOpW3ormvyAD/H+G1hgvEg1huUzdobNrRKmEA= From: Andrea Righi To: Balbir Singh , Paul Menage Cc: agk@sourceware.org, akpm@linux-foundation.org, axboe@kernel.dk, baramsori72@gmail.com, Carl Henrik Lunde , dave@linux.vnet.ibm.com, Divyesh Shah , eric.rannaud@gmail.com, fernando@oss.ntt.co.jp, Hirokazu Takahashi , Li Zefan , Marco Innocenti , matt@bluehost.com, ngupta@google.com, randy.dunlap@oracle.com, roberto@unbit.it, Ryo Tsuruta , Satoshi UCHIDA , subrata@linux.vnet.ibm.com, yoshikawa.takuya@oss.ntt.co.jp, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Andrea Righi Subject: [PATCH -mm 6/6] export per-task i/o throttling statistics to userspace Date: Wed, 17 Sep 2008 13:05:28 +0200 Message-Id: <1221649528-8519-7-git-send-email-righi.andrea@gmail.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <> References: <> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export the throttling statistics collected for each task through /proc/PID/io-throttle-stat: - total number of delayed I/O request - total amount of time in clock ticks spent to wait for the delayed requests Signed-off-by: Andrea Righi --- fs/proc/base.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 63617ca..e53b06c 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -2459,6 +2460,14 @@ static int proc_tgid_io_accounting(struct task_struct *task, char *buffer) } #endif /* CONFIG_TASK_IO_ACCOUNTING */ +#ifdef CONFIG_CGROUP_IO_THROTTLE +static int proc_iothrottle_stat(struct task_struct *task, char *buffer) +{ + return sprintf(buffer, "%llu %llu\n", + get_io_throttle_cnt(task), get_io_throttle_sleep(task)); +} +#endif /* CONFIG_CGROUP_IO_THROTTLE */ + /* * Thread groups */ @@ -2534,6 +2543,9 @@ static const struct pid_entry tgid_base_stuff[] = { #ifdef CONFIG_TASK_IO_ACCOUNTING INF("io", S_IRUGO, tgid_io_accounting), #endif +#ifdef CONFIG_CGROUP_IO_THROTTLE + INF("io-throttle-stat", S_IRUGO, iothrottle_stat), +#endif }; static int proc_tgid_base_readdir(struct file * filp, @@ -2865,6 +2877,9 @@ static const struct pid_entry tid_base_stuff[] = { #ifdef CONFIG_TASK_IO_ACCOUNTING INF("io", S_IRUGO, tid_io_accounting), #endif +#ifdef CONFIG_CGROUP_IO_THROTTLE + INF("io-throttle-stat", S_IRUGO, iothrottle_stat), +#endif }; static int proc_tid_base_readdir(struct file * filp, -- 1.5.4.3