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 /drivers/cpufreq | |
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 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 41 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 41 |
2 files changed, 40 insertions, 42 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 7f31a031c0b5..235a340e81f2 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
@@ -95,26 +95,26 @@ static struct dbs_tuners { | |||
95 | .freq_step = 5, | 95 | .freq_step = 5, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu, | 98 | static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall) |
99 | cputime64_t *wall) | ||
100 | { | 99 | { |
101 | cputime64_t idle_time; | 100 | u64 idle_time; |
102 | cputime64_t cur_wall_time; | 101 | u64 cur_wall_time; |
103 | cputime64_t busy_time; | 102 | u64 busy_time; |
104 | 103 | ||
105 | cur_wall_time = jiffies64_to_cputime64(get_jiffies_64()); | 104 | cur_wall_time = jiffies64_to_cputime64(get_jiffies_64()); |
106 | busy_time = kstat_cpu(cpu).cpustat.user; | 105 | |
107 | busy_time += kstat_cpu(cpu).cpustat.system; | 106 | busy_time = kcpustat_cpu(cpu).cpustat[CPUTIME_USER]; |
108 | busy_time += kstat_cpu(cpu).cpustat.irq; | 107 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM]; |
109 | busy_time += kstat_cpu(cpu).cpustat.softirq; | 108 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_IRQ]; |
110 | busy_time += kstat_cpu(cpu).cpustat.steal; | 109 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SOFTIRQ]; |
111 | busy_time += kstat_cpu(cpu).cpustat.nice; | 110 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_STEAL]; |
111 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_NICE]; | ||
112 | 112 | ||
113 | idle_time = cur_wall_time - busy_time; | 113 | idle_time = cur_wall_time - busy_time; |
114 | if (wall) | 114 | if (wall) |
115 | *wall = (cputime64_t)jiffies_to_usecs(cur_wall_time); | 115 | *wall = jiffies_to_usecs(cur_wall_time); |
116 | 116 | ||
117 | return (cputime64_t)jiffies_to_usecs(idle_time); | 117 | return jiffies_to_usecs(idle_time); |
118 | } | 118 | } |
119 | 119 | ||
120 | static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) | 120 | static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) |
@@ -271,7 +271,7 @@ static ssize_t store_ignore_nice_load(struct kobject *a, struct attribute *b, | |||
271 | dbs_info->prev_cpu_idle = get_cpu_idle_time(j, | 271 | dbs_info->prev_cpu_idle = get_cpu_idle_time(j, |
272 | &dbs_info->prev_cpu_wall); | 272 | &dbs_info->prev_cpu_wall); |
273 | if (dbs_tuners_ins.ignore_nice) | 273 | if (dbs_tuners_ins.ignore_nice) |
274 | dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; | 274 | dbs_info->prev_cpu_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE]; |
275 | } | 275 | } |
276 | return count; | 276 | return count; |
277 | } | 277 | } |
@@ -361,11 +361,11 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) | |||
361 | j_dbs_info->prev_cpu_idle = cur_idle_time; | 361 | j_dbs_info->prev_cpu_idle = cur_idle_time; |
362 | 362 | ||
363 | if (dbs_tuners_ins.ignore_nice) { | 363 | if (dbs_tuners_ins.ignore_nice) { |
364 | cputime64_t cur_nice; | 364 | u64 cur_nice; |
365 | unsigned long cur_nice_jiffies; | 365 | unsigned long cur_nice_jiffies; |
366 | 366 | ||
367 | cur_nice = kstat_cpu(j).cpustat.nice - | 367 | cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE] - |
368 | j_dbs_info->prev_cpu_nice; | 368 | j_dbs_info->prev_cpu_nice; |
369 | /* | 369 | /* |
370 | * Assumption: nice time between sampling periods will | 370 | * Assumption: nice time between sampling periods will |
371 | * be less than 2^32 jiffies for 32 bit sys | 371 | * be less than 2^32 jiffies for 32 bit sys |
@@ -373,7 +373,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) | |||
373 | cur_nice_jiffies = (unsigned long) | 373 | cur_nice_jiffies = (unsigned long) |
374 | cputime64_to_jiffies64(cur_nice); | 374 | cputime64_to_jiffies64(cur_nice); |
375 | 375 | ||
376 | j_dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; | 376 | j_dbs_info->prev_cpu_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE]; |
377 | idle_time += jiffies_to_usecs(cur_nice_jiffies); | 377 | idle_time += jiffies_to_usecs(cur_nice_jiffies); |
378 | } | 378 | } |
379 | 379 | ||
@@ -500,10 +500,9 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
500 | 500 | ||
501 | j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j, | 501 | j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j, |
502 | &j_dbs_info->prev_cpu_wall); | 502 | &j_dbs_info->prev_cpu_wall); |
503 | if (dbs_tuners_ins.ignore_nice) { | 503 | if (dbs_tuners_ins.ignore_nice) |
504 | j_dbs_info->prev_cpu_nice = | 504 | j_dbs_info->prev_cpu_nice = |
505 | kstat_cpu(j).cpustat.nice; | 505 | kcpustat_cpu(j).cpustat[CPUTIME_NICE]; |
506 | } | ||
507 | } | 506 | } |
508 | this_dbs_info->down_skip = 0; | 507 | this_dbs_info->down_skip = 0; |
509 | this_dbs_info->requested_freq = policy->cur; | 508 | this_dbs_info->requested_freq = policy->cur; |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 07cffe2f6cff..3d679eee70a1 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -119,26 +119,26 @@ static struct dbs_tuners { | |||
119 | .powersave_bias = 0, | 119 | .powersave_bias = 0, |
120 | }; | 120 | }; |
121 | 121 | ||
122 | static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu, | 122 | static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall) |
123 | cputime64_t *wall) | ||
124 | { | 123 | { |
125 | cputime64_t idle_time; | 124 | u64 idle_time; |
126 | cputime64_t cur_wall_time; | 125 | u64 cur_wall_time; |
127 | cputime64_t busy_time; | 126 | u64 busy_time; |
128 | 127 | ||
129 | cur_wall_time = jiffies64_to_cputime64(get_jiffies_64()); | 128 | cur_wall_time = jiffies64_to_cputime64(get_jiffies_64()); |
130 | busy_time = kstat_cpu(cpu).cpustat.user; | 129 | |
131 | busy_time += kstat_cpu(cpu).cpustat.system; | 130 | busy_time = kcpustat_cpu(cpu).cpustat[CPUTIME_USER]; |
132 | busy_time += kstat_cpu(cpu).cpustat.irq; | 131 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM]; |
133 | busy_time += kstat_cpu(cpu).cpustat.softirq; | 132 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_IRQ]; |
134 | busy_time += kstat_cpu(cpu).cpustat.steal; | 133 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SOFTIRQ]; |
135 | busy_time += kstat_cpu(cpu).cpustat.nice; | 134 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_STEAL]; |
135 | busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_NICE]; | ||
136 | 136 | ||
137 | idle_time = cur_wall_time - busy_time; | 137 | idle_time = cur_wall_time - busy_time; |
138 | if (wall) | 138 | if (wall) |
139 | *wall = (cputime64_t)jiffies_to_usecs(cur_wall_time); | 139 | *wall = jiffies_to_usecs(cur_wall_time); |
140 | 140 | ||
141 | return (cputime64_t)jiffies_to_usecs(idle_time); | 141 | return jiffies_to_usecs(idle_time); |
142 | } | 142 | } |
143 | 143 | ||
144 | static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) | 144 | static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) |
@@ -344,7 +344,7 @@ static ssize_t store_ignore_nice_load(struct kobject *a, struct attribute *b, | |||
344 | dbs_info->prev_cpu_idle = get_cpu_idle_time(j, | 344 | dbs_info->prev_cpu_idle = get_cpu_idle_time(j, |
345 | &dbs_info->prev_cpu_wall); | 345 | &dbs_info->prev_cpu_wall); |
346 | if (dbs_tuners_ins.ignore_nice) | 346 | if (dbs_tuners_ins.ignore_nice) |
347 | dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; | 347 | dbs_info->prev_cpu_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE]; |
348 | 348 | ||
349 | } | 349 | } |
350 | return count; | 350 | return count; |
@@ -454,11 +454,11 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) | |||
454 | j_dbs_info->prev_cpu_iowait = cur_iowait_time; | 454 | j_dbs_info->prev_cpu_iowait = cur_iowait_time; |
455 | 455 | ||
456 | if (dbs_tuners_ins.ignore_nice) { | 456 | if (dbs_tuners_ins.ignore_nice) { |
457 | cputime64_t cur_nice; | 457 | u64 cur_nice; |
458 | unsigned long cur_nice_jiffies; | 458 | unsigned long cur_nice_jiffies; |
459 | 459 | ||
460 | cur_nice = kstat_cpu(j).cpustat.nice - | 460 | cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE] - |
461 | j_dbs_info->prev_cpu_nice; | 461 | j_dbs_info->prev_cpu_nice; |
462 | /* | 462 | /* |
463 | * Assumption: nice time between sampling periods will | 463 | * Assumption: nice time between sampling periods will |
464 | * be less than 2^32 jiffies for 32 bit sys | 464 | * be less than 2^32 jiffies for 32 bit sys |
@@ -466,7 +466,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) | |||
466 | cur_nice_jiffies = (unsigned long) | 466 | cur_nice_jiffies = (unsigned long) |
467 | cputime64_to_jiffies64(cur_nice); | 467 | cputime64_to_jiffies64(cur_nice); |
468 | 468 | ||
469 | j_dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; | 469 | j_dbs_info->prev_cpu_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE]; |
470 | idle_time += jiffies_to_usecs(cur_nice_jiffies); | 470 | idle_time += jiffies_to_usecs(cur_nice_jiffies); |
471 | } | 471 | } |
472 | 472 | ||
@@ -645,10 +645,9 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
645 | 645 | ||
646 | j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j, | 646 | j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j, |
647 | &j_dbs_info->prev_cpu_wall); | 647 | &j_dbs_info->prev_cpu_wall); |
648 | if (dbs_tuners_ins.ignore_nice) { | 648 | if (dbs_tuners_ins.ignore_nice) |
649 | j_dbs_info->prev_cpu_nice = | 649 | j_dbs_info->prev_cpu_nice = |
650 | kstat_cpu(j).cpustat.nice; | 650 | kcpustat_cpu(j).cpustat[CPUTIME_NICE]; |
651 | } | ||
652 | } | 651 | } |
653 | this_dbs_info->cpu = cpu; | 652 | this_dbs_info->cpu = cpu; |
654 | this_dbs_info->rate_mult = 1; | 653 | this_dbs_info->rate_mult = 1; |