diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-12-19 13:23:15 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-12-19 13:23:15 -0500 |
commit | 612ef28a045efadb3a98d4492ead7806a146485d (patch) | |
tree | 05621c87b37e91c27b06d450d76adffe97ce9666 /fs/proc | |
parent | c3e0ef9a298e028a82ada28101ccd5cf64d209ee (diff) | |
parent | 07cde2608a3b5c66515363f1b53623b1536b9785 (diff) |
Merge branch 'sched/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into cputime-tip
Conflicts:
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_ondemand.c
drivers/macintosh/rack-meter.c
fs/proc/stat.c
fs/proc/uptime.c
kernel/sched/core.c
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/stat.c | 52 | ||||
-rw-r--r-- | fs/proc/uptime.c | 4 |
2 files changed, 26 insertions, 30 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 714d5d131e76..2527a68057fc 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c | |||
@@ -22,14 +22,13 @@ | |||
22 | #define arch_idle_time(cpu) 0 | 22 | #define arch_idle_time(cpu) 0 |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | static cputime64_t get_idle_time(int cpu) | 25 | static u64 get_idle_time(int cpu) |
26 | { | 26 | { |
27 | u64 idle_time = get_cpu_idle_time_us(cpu, NULL); | 27 | u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL); |
28 | cputime64_t idle; | ||
29 | 28 | ||
30 | if (idle_time == -1ULL) { | 29 | if (idle_time == -1ULL) { |
31 | /* !NO_HZ so we can rely on cpustat.idle */ | 30 | /* !NO_HZ so we can rely on cpustat.idle */ |
32 | idle = kstat_cpu(cpu).cpustat.idle; | 31 | idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; |
33 | idle += arch_idle_time(cpu); | 32 | idle += arch_idle_time(cpu); |
34 | } else | 33 | } else |
35 | idle = nsecs_to_jiffies64(1000 * idle_time); | 34 | idle = nsecs_to_jiffies64(1000 * idle_time); |
@@ -37,14 +36,13 @@ static cputime64_t get_idle_time(int cpu) | |||
37 | return idle; | 36 | return idle; |
38 | } | 37 | } |
39 | 38 | ||
40 | static cputime64_t get_iowait_time(int cpu) | 39 | static u64 get_iowait_time(int cpu) |
41 | { | 40 | { |
42 | u64 iowait_time = get_cpu_iowait_time_us(cpu, NULL); | 41 | u64 iowait, iowait_time = get_cpu_iowait_time_us(cpu, NULL); |
43 | cputime64_t iowait; | ||
44 | 42 | ||
45 | if (iowait_time == -1ULL) | 43 | if (iowait_time == -1ULL) |
46 | /* !NO_HZ so we can rely on cpustat.iowait */ | 44 | /* !NO_HZ so we can rely on cpustat.iowait */ |
47 | iowait = kstat_cpu(cpu).cpustat.iowait; | 45 | iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; |
48 | else | 46 | else |
49 | iowait = nsecs_to_jiffies64(1000 * iowait_time); | 47 | iowait = nsecs_to_jiffies64(1000 * iowait_time); |
50 | 48 | ||
@@ -55,8 +53,8 @@ static int show_stat(struct seq_file *p, void *v) | |||
55 | { | 53 | { |
56 | int i, j; | 54 | int i, j; |
57 | unsigned long jif; | 55 | unsigned long jif; |
58 | cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; | 56 | u64 user, nice, system, idle, iowait, irq, softirq, steal; |
59 | cputime64_t guest, guest_nice; | 57 | u64 guest, guest_nice; |
60 | u64 sum = 0; | 58 | u64 sum = 0; |
61 | u64 sum_softirq = 0; | 59 | u64 sum_softirq = 0; |
62 | unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; | 60 | unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; |
@@ -69,18 +67,16 @@ static int show_stat(struct seq_file *p, void *v) | |||
69 | jif = boottime.tv_sec; | 67 | jif = boottime.tv_sec; |
70 | 68 | ||
71 | for_each_possible_cpu(i) { | 69 | for_each_possible_cpu(i) { |
72 | user += kstat_cpu(i).cpustat.user; | 70 | user += kcpustat_cpu(i).cpustat[CPUTIME_USER]; |
73 | nice += kstat_cpu(i).cpustat.nice; | 71 | nice += kcpustat_cpu(i).cpustat[CPUTIME_NICE]; |
74 | system += kstat_cpu(i).cpustat.system; | 72 | system += kcpustat_cpu(i).cpustat[CPUTIME_SYSTEM]; |
75 | idle += get_idle_time(i); | 73 | idle += get_idle_time(i); |
76 | iowait += get_iowait_time(i); | 74 | iowait += get_iowait_time(i); |
77 | irq += kstat_cpu(i).cpustat.irq; | 75 | irq += kcpustat_cpu(i).cpustat[CPUTIME_IRQ]; |
78 | softirq += kstat_cpu(i).cpustat.softirq; | 76 | softirq += kcpustat_cpu(i).cpustat[CPUTIME_SOFTIRQ]; |
79 | steal += kstat_cpu(i).cpustat.steal; | 77 | steal += kcpustat_cpu(i).cpustat[CPUTIME_STEAL]; |
80 | guest += kstat_cpu(i).cpustat.guest; | 78 | guest += kcpustat_cpu(i).cpustat[CPUTIME_GUEST]; |
81 | guest_nice += kstat_cpu(i).cpustat.guest_nice; | 79 | guest_nice += kcpustat_cpu(i).cpustat[CPUTIME_GUEST_NICE]; |
82 | sum += kstat_cpu_irqs_sum(i); | ||
83 | sum += arch_irq_stat_cpu(i); | ||
84 | 80 | ||
85 | for (j = 0; j < NR_SOFTIRQS; j++) { | 81 | for (j = 0; j < NR_SOFTIRQS; j++) { |
86 | unsigned int softirq_stat = kstat_softirqs_cpu(j, i); | 82 | unsigned int softirq_stat = kstat_softirqs_cpu(j, i); |
@@ -105,16 +101,16 @@ static int show_stat(struct seq_file *p, void *v) | |||
105 | (unsigned long long)cputime64_to_clock_t(guest_nice)); | 101 | (unsigned long long)cputime64_to_clock_t(guest_nice)); |
106 | for_each_online_cpu(i) { | 102 | for_each_online_cpu(i) { |
107 | /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ | 103 | /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ |
108 | user = kstat_cpu(i).cpustat.user; | 104 | user = kcpustat_cpu(i).cpustat[CPUTIME_USER]; |
109 | nice = kstat_cpu(i).cpustat.nice; | 105 | nice = kcpustat_cpu(i).cpustat[CPUTIME_NICE]; |
110 | system = kstat_cpu(i).cpustat.system; | 106 | system = kcpustat_cpu(i).cpustat[CPUTIME_SYSTEM]; |
111 | idle = get_idle_time(i); | 107 | idle = get_idle_time(i); |
112 | iowait = get_iowait_time(i); | 108 | iowait = get_iowait_time(i); |
113 | irq = kstat_cpu(i).cpustat.irq; | 109 | irq = kcpustat_cpu(i).cpustat[CPUTIME_IRQ]; |
114 | softirq = kstat_cpu(i).cpustat.softirq; | 110 | softirq = kcpustat_cpu(i).cpustat[CPUTIME_SOFTIRQ]; |
115 | steal = kstat_cpu(i).cpustat.steal; | 111 | steal = kcpustat_cpu(i).cpustat[CPUTIME_STEAL]; |
116 | guest = kstat_cpu(i).cpustat.guest; | 112 | guest = kcpustat_cpu(i).cpustat[CPUTIME_GUEST]; |
117 | guest_nice = kstat_cpu(i).cpustat.guest_nice; | 113 | guest_nice = kcpustat_cpu(i).cpustat[CPUTIME_GUEST_NICE]; |
118 | seq_printf(p, | 114 | seq_printf(p, |
119 | "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu " | 115 | "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu " |
120 | "%llu\n", | 116 | "%llu\n", |
diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index ab515109fec9..9610ac772d7e 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c | |||
@@ -11,14 +11,14 @@ static int uptime_proc_show(struct seq_file *m, void *v) | |||
11 | { | 11 | { |
12 | struct timespec uptime; | 12 | struct timespec uptime; |
13 | struct timespec idle; | 13 | struct timespec idle; |
14 | cputime64_t idletime; | 14 | u64 idletime; |
15 | u64 nsec; | 15 | u64 nsec; |
16 | u32 rem; | 16 | u32 rem; |
17 | int i; | 17 | int i; |
18 | 18 | ||
19 | idletime = 0; | 19 | idletime = 0; |
20 | for_each_possible_cpu(i) | 20 | for_each_possible_cpu(i) |
21 | idletime += kstat_cpu(i).cpustat.idle; | 21 | idletime += (__force u64) kcpustat_cpu(i).cpustat[CPUTIME_IDLE]; |
22 | 22 | ||
23 | do_posix_clock_monotonic_gettime(&uptime); | 23 | do_posix_clock_monotonic_gettime(&uptime); |
24 | monotonic_to_bootbased(&uptime); | 24 | monotonic_to_bootbased(&uptime); |