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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 28 Nov 2011 17:45:45 -0500
From:	Satoru Moriya <satoru.moriya@....com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	"bsingharora@...il.com" <bsingharora@...il.com>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"peterz@...radead.org" <peterz@...radead.org>,
	"nagar@...son.ibm.com" <nagar@...son.ibm.com>,
	"kobayashi.kk@...s.nec.co.jp" <kobayashi.kk@...s.nec.co.jp>,
	Randy Dunlap <rdunlap@...otime.net>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"dle-develop@...ts.sourceforge.net" 
	<dle-develop@...ts.sourceforge.net>,
	Seiji Aguchi <seiji.aguchi@....com>
Subject: [PATCH 2/4] delayacct: add members to struct task_delay_info to
 save max delays

This patch adds members to struct task_delay_info and a parameter to
delayacct_end() and saves maximum values for IO/SWAP/RECLAIM delays.

Signed-off-by: Satoru Moriya <satoru.moriya@....com>
---
 include/linux/sched.h |    3 +++
 kernel/delayacct.c    |   13 +++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1665e2c..edd8ad2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -768,6 +768,8 @@ struct task_delay_info {
 	struct timespec blkio_start, blkio_end;	/* Shared by blkio, swapin */
 	u64 blkio_delay;	/* wait for sync block io completion */
 	u64 swapin_delay;	/* wait for swapin block io completion */
+	u64 blkio_delay_max;    /* max wait for sync block io completion */
+	u64 swapin_delay_max;   /* max wait for swapin block io completion */
 	u32 blkio_count;	/* total count of the number of sync block */
 				/* io operations performed */
 	u32 swapin_count;	/* total count of the number of swapin block */
@@ -775,6 +777,7 @@ struct task_delay_info {
 
 	struct timespec freepages_start, freepages_end;
 	u64 freepages_delay;	/* wait for memory reclaim */
+	u64 freepages_delay_max;/* max wait for memory reclaim */
 	u32 freepages_count;	/* total count of memory reclaim */
 };
 #endif	/* CONFIG_TASK_DELAY_ACCT */
diff --git a/kernel/delayacct.c b/kernel/delayacct.c
index 418b3f7..33d090b 100644
--- a/kernel/delayacct.c
+++ b/kernel/delayacct.c
@@ -61,7 +61,7 @@ static inline void delayacct_start(struct timespec *start)
  */
 
 static void delayacct_end(struct timespec *start, struct timespec *end,
-				u64 *total, u32 *count)
+				u64 *total, u32 *count, u64 *max)
 {
 	struct timespec ts;
 	s64 ns;
@@ -76,6 +76,8 @@ static void delayacct_end(struct timespec *start, struct timespec *end,
 	spin_lock_irqsave(&current->delays->lock, flags);
 	*total += ns;
 	(*count)++;
+	if (*max < ns)
+		*max = ns;
 	spin_unlock_irqrestore(&current->delays->lock, flags);
 }
 
@@ -91,12 +93,14 @@ void __delayacct_blkio_end(void)
 		delayacct_end(&current->delays->blkio_start,
 			&current->delays->blkio_end,
 			&current->delays->swapin_delay,
-			&current->delays->swapin_count);
+			&current->delays->swapin_count,
+			&current->delays->swapin_delay_max);
 	else	/* Other block I/O */
 		delayacct_end(&current->delays->blkio_start,
 			&current->delays->blkio_end,
 			&current->delays->blkio_delay,
-			&current->delays->blkio_count);
+			&current->delays->blkio_count,
+			&current->delays->blkio_delay_max);
 }
 
 int __delayacct_add_tsk(struct taskstats *d, struct task_struct *tsk)
@@ -181,6 +185,7 @@ void __delayacct_freepages_end(void)
 	delayacct_end(&current->delays->freepages_start,
 			&current->delays->freepages_end,
 			&current->delays->freepages_delay,
-			&current->delays->freepages_count);
+			&current->delays->freepages_count,
+			&current->delays->freepages_delay_max);
 }
 
-- 
1.7.6.4


--
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