[kernel] r14240 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Tue Sep 15 12:56:14 UTC 2009


Author: benh
Date: Tue Sep 15 12:56:13 2009
New Revision: 14240

Log:
proc: Fix idle time in /proc/uptime (Closes: #545981)

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/fix-proc-uptime-idle-time.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/7

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Tue Sep 15 12:54:12 2009	(r14239)
+++ dists/sid/linux-2.6/debian/changelog	Tue Sep 15 12:56:13 2009	(r14240)
@@ -18,6 +18,7 @@
     corruption and GPU lock-ups (Closes: #541307)
   * x86, pat: Allow ISA memory range uncacheable mapping requests
     (Closes: #538159)
+  * proc: Fix idle time in /proc/uptime (Closes: #545981)
 
   [ Bastian Blank ]
   * Add stable release 2.6.30.5.

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/fix-proc-uptime-idle-time.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/fix-proc-uptime-idle-time.patch	Tue Sep 15 12:56:13 2009	(r14240)
@@ -0,0 +1,42 @@
+From 27bf8712477db47c891e6198000c985631cd18de Mon Sep 17 00:00:00 2001
+From: Michael Abbott <michael.abbott at diamond.ac.uk>
+Date: Mon, 22 Jun 2009 12:19:25 +0200
+Subject: [PATCH] [PATCH] Fix idle time field in /proc/uptime
+
+Git commit 79741dd changes idle cputime accounting, but unfortunately
+the /proc/uptime file hasn't caught up.  Here the idle time calculation
+from /proc/stat is copied over.
+
+Signed-off-by: Michael Abbott <michael.abbott at diamond.ac.uk>
+Signed-off-by: Martin Schwidefsky <schwidefsky at de.ibm.com>
+---
+ fs/proc/uptime.c |    7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c
+index 0c10a0b..766b1d4 100644
+--- a/fs/proc/uptime.c
++++ b/fs/proc/uptime.c
+@@ -4,13 +4,18 @@
+ #include <linux/sched.h>
+ #include <linux/seq_file.h>
+ #include <linux/time.h>
++#include <linux/kernel_stat.h>
+ #include <asm/cputime.h>
+ 
+ static int uptime_proc_show(struct seq_file *m, void *v)
+ {
+ 	struct timespec uptime;
+ 	struct timespec idle;
+-	cputime_t idletime = cputime_add(init_task.utime, init_task.stime);
++	int i;
++	cputime_t idletime = cputime_zero;
++
++	for_each_possible_cpu(i)
++		idletime = cputime64_add(idletime, kstat_cpu(i).cpustat.idle);
+ 
+ 	do_posix_clock_monotonic_gettime(&uptime);
+ 	monotonic_to_bootbased(&uptime);
+-- 
+1.6.3.3
+

Modified: dists/sid/linux-2.6/debian/patches/series/7
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/7	Tue Sep 15 12:54:12 2009	(r14239)
+++ dists/sid/linux-2.6/debian/patches/series/7	Tue Sep 15 12:56:13 2009	(r14240)
@@ -18,3 +18,4 @@
 + bugfix/all/stable/2.6.30.5.patch
 + bugfix/all/stable/2.6.30.6.patch
 + bugfix/x86/x86-pat-allow-isa-memory-uncacheable-mapping.patch
++ bugfix/all/fix-proc-uptime-idle-time.patch



More information about the Kernel-svn-changes mailing list