aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-20 15:52:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-20 15:52:55 -0500
commit828cad8ea05d194d8a9452e0793261c2024c23a2 (patch)
tree0ad7c7e044cdcfe75d78da0b52eb2358d4686e02 /drivers
parent60c906bab124a0627fba04c9ca5e61bba4747c0c (diff)
parentbb3bac2ca9a3a5b7fa601781adf70167a0449d75 (diff)
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler updates from Ingo Molnar: "The main changes in this (fairly busy) cycle were: - There was a class of scheduler bugs related to forgetting to update the rq-clock timestamp which can cause weird and hard to debug problems, so there's a new debug facility for this: which uncovered a whole lot of bugs which convinced us that we want to keep the debug facility. (Peter Zijlstra, Matt Fleming) - Various cputime related updates: eliminate cputime and use u64 nanoseconds directly, simplify and improve the arch interfaces, implement delayed accounting more widely, etc. - (Frederic Weisbecker) - Move code around for better structure plus cleanups (Ingo Molnar) - Move IO schedule accounting deeper into the scheduler plus related changes to improve the situation (Tejun Heo) - ... plus a round of sched/rt and sched/deadline fixes, plus other fixes, updats and cleanups" * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (85 commits) sched/core: Remove unlikely() annotation from sched_move_task() sched/autogroup: Rename auto_group.[ch] to autogroup.[ch] sched/topology: Split out scheduler topology code from core.c into topology.c sched/core: Remove unnecessary #include headers sched/rq_clock: Consolidate the ordering of the rq_clock methods delayacct: Include <uapi/linux/taskstats.h> sched/core: Clean up comments sched/rt: Show the 'sched_rr_timeslice' SCHED_RR timeslice tuning knob in milliseconds sched/clock: Add dummy clear_sched_clock_stable() stub function sched/cputime: Remove generic asm headers sched/cputime: Remove unused nsec_to_cputime() s390, sched/cputime: Remove unused cputime definitions powerpc, sched/cputime: Remove unused cputime definitions s390, sched/cputime: Make arch_cpu_idle_time() to return nsecs ia64, sched/cputime: Remove unused cputime definitions ia64: Convert vtime to use nsec units directly ia64, sched/cputime: Move the nsecs based cputime headers to the last arch using it sched/cputime: Remove jiffies based cputime sched/cputime, vtime: Return nsecs instead of cputime_t to account sched/cputime: Complete nsec conversion of tick based accounting ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/cpufreq.c6
-rw-r--r--drivers/cpufreq/cpufreq_governor.c2
-rw-r--r--drivers/cpufreq/cpufreq_stats.c1
-rw-r--r--drivers/isdn/mISDN/stack.c4
-rw-r--r--drivers/macintosh/rack-meter.c28
5 files changed, 20 insertions, 21 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index cc475eff90b3..3e9b319a2e79 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -132,7 +132,7 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
132 u64 cur_wall_time; 132 u64 cur_wall_time;
133 u64 busy_time; 133 u64 busy_time;
134 134
135 cur_wall_time = jiffies64_to_cputime64(get_jiffies_64()); 135 cur_wall_time = jiffies64_to_nsecs(get_jiffies_64());
136 136
137 busy_time = kcpustat_cpu(cpu).cpustat[CPUTIME_USER]; 137 busy_time = kcpustat_cpu(cpu).cpustat[CPUTIME_USER];
138 busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM]; 138 busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM];
@@ -143,9 +143,9 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
143 143
144 idle_time = cur_wall_time - busy_time; 144 idle_time = cur_wall_time - busy_time;
145 if (wall) 145 if (wall)
146 *wall = cputime_to_usecs(cur_wall_time); 146 *wall = div_u64(cur_wall_time, NSEC_PER_USEC);
147 147
148 return cputime_to_usecs(idle_time); 148 return div_u64(idle_time, NSEC_PER_USEC);
149} 149}
150 150
151u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy) 151u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy)
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 0196467280bd..631bd2c86c5e 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -152,7 +152,7 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
152 if (ignore_nice) { 152 if (ignore_nice) {
153 u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE]; 153 u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];
154 154
155 idle_time += cputime_to_usecs(cur_nice - j_cdbs->prev_cpu_nice); 155 idle_time += div_u64(cur_nice - j_cdbs->prev_cpu_nice, NSEC_PER_USEC);
156 j_cdbs->prev_cpu_nice = cur_nice; 156 j_cdbs->prev_cpu_nice = cur_nice;
157 } 157 }
158 158
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index ac284e66839c..17048bbec287 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -13,7 +13,6 @@
13#include <linux/cpufreq.h> 13#include <linux/cpufreq.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/cputime.h>
17 16
18static DEFINE_SPINLOCK(cpufreq_stats_lock); 17static DEFINE_SPINLOCK(cpufreq_stats_lock);
19 18
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c
index 9cb4b621fbc3..b324474c0c12 100644
--- a/drivers/isdn/mISDN/stack.c
+++ b/drivers/isdn/mISDN/stack.c
@@ -203,7 +203,7 @@ mISDNStackd(void *data)
203{ 203{
204 struct mISDNstack *st = data; 204 struct mISDNstack *st = data;
205#ifdef MISDN_MSG_STATS 205#ifdef MISDN_MSG_STATS
206 cputime_t utime, stime; 206 u64 utime, stime;
207#endif 207#endif
208 int err = 0; 208 int err = 0;
209 209
@@ -308,7 +308,7 @@ mISDNStackd(void *data)
308 st->stopped_cnt); 308 st->stopped_cnt);
309 task_cputime(st->thread, &utime, &stime); 309 task_cputime(st->thread, &utime, &stime);
310 printk(KERN_DEBUG 310 printk(KERN_DEBUG
311 "mISDNStackd daemon for %s utime(%ld) stime(%ld)\n", 311 "mISDNStackd daemon for %s utime(%llu) stime(%llu)\n",
312 dev_name(&st->dev->dev), utime, stime); 312 dev_name(&st->dev->dev), utime, stime);
313 printk(KERN_DEBUG 313 printk(KERN_DEBUG
314 "mISDNStackd daemon for %s nvcsw(%ld) nivcsw(%ld)\n", 314 "mISDNStackd daemon for %s nvcsw(%ld) nivcsw(%ld)\n",
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index 775527135b93..e199fd6c71ce 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -52,8 +52,8 @@ struct rackmeter_dma {
52struct rackmeter_cpu { 52struct rackmeter_cpu {
53 struct delayed_work sniffer; 53 struct delayed_work sniffer;
54 struct rackmeter *rm; 54 struct rackmeter *rm;
55 cputime64_t prev_wall; 55 u64 prev_wall;
56 cputime64_t prev_idle; 56 u64 prev_idle;
57 int zero; 57 int zero;
58} ____cacheline_aligned; 58} ____cacheline_aligned;
59 59
@@ -81,7 +81,7 @@ static int rackmeter_ignore_nice;
81/* This is copied from cpufreq_ondemand, maybe we should put it in 81/* This is copied from cpufreq_ondemand, maybe we should put it in
82 * a common header somewhere 82 * a common header somewhere
83 */ 83 */
84static inline cputime64_t get_cpu_idle_time(unsigned int cpu) 84static inline u64 get_cpu_idle_time(unsigned int cpu)
85{ 85{
86 u64 retval; 86 u64 retval;
87 87
@@ -217,23 +217,23 @@ static void rackmeter_do_timer(struct work_struct *work)
217 container_of(work, struct rackmeter_cpu, sniffer.work); 217 container_of(work, struct rackmeter_cpu, sniffer.work);
218 struct rackmeter *rm = rcpu->rm; 218 struct rackmeter *rm = rcpu->rm;
219 unsigned int cpu = smp_processor_id(); 219 unsigned int cpu = smp_processor_id();
220 cputime64_t cur_jiffies, total_idle_ticks; 220 u64 cur_nsecs, total_idle_nsecs;
221 unsigned int total_ticks, idle_ticks; 221 u64 total_nsecs, idle_nsecs;
222 int i, offset, load, cumm, pause; 222 int i, offset, load, cumm, pause;
223 223
224 cur_jiffies = jiffies64_to_cputime64(get_jiffies_64()); 224 cur_nsecs = jiffies64_to_nsecs(get_jiffies_64());
225 total_ticks = (unsigned int) (cur_jiffies - rcpu->prev_wall); 225 total_nsecs = cur_nsecs - rcpu->prev_wall;
226 rcpu->prev_wall = cur_jiffies; 226 rcpu->prev_wall = cur_nsecs;
227 227
228 total_idle_ticks = get_cpu_idle_time(cpu); 228 total_idle_nsecs = get_cpu_idle_time(cpu);
229 idle_ticks = (unsigned int) (total_idle_ticks - rcpu->prev_idle); 229 idle_nsecs = total_idle_nsecs - rcpu->prev_idle;
230 idle_ticks = min(idle_ticks, total_ticks); 230 idle_nsecs = min(idle_nsecs, total_nsecs);
231 rcpu->prev_idle = total_idle_ticks; 231 rcpu->prev_idle = total_idle_nsecs;
232 232
233 /* We do a very dumb calculation to update the LEDs for now, 233 /* We do a very dumb calculation to update the LEDs for now,
234 * we'll do better once we have actual PWM implemented 234 * we'll do better once we have actual PWM implemented
235 */ 235 */
236 load = (9 * (total_ticks - idle_ticks)) / total_ticks; 236 load = div64_u64(9 * (total_nsecs - idle_nsecs), total_nsecs);
237 237
238 offset = cpu << 3; 238 offset = cpu << 3;
239 cumm = 0; 239 cumm = 0;
@@ -278,7 +278,7 @@ static void rackmeter_init_cpu_sniffer(struct rackmeter *rm)
278 continue; 278 continue;
279 rcpu = &rm->cpu[cpu]; 279 rcpu = &rm->cpu[cpu];
280 rcpu->prev_idle = get_cpu_idle_time(cpu); 280 rcpu->prev_idle = get_cpu_idle_time(cpu);
281 rcpu->prev_wall = jiffies64_to_cputime64(get_jiffies_64()); 281 rcpu->prev_wall = jiffies64_to_nsecs(get_jiffies_64());
282 schedule_delayed_work_on(cpu, &rm->cpu[cpu].sniffer, 282 schedule_delayed_work_on(cpu, &rm->cpu[cpu].sniffer,
283 msecs_to_jiffies(CPU_SAMPLING_RATE)); 283 msecs_to_jiffies(CPU_SAMPLING_RATE));
284 } 284 }