aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-07 18:31:39 -0400
committerArjan van de Ven <arjan@linux.intel.com>2008-09-07 18:31:39 -0400
commit4ce105d30e08fb8a1783c55a0e48aa3fa200c455 (patch)
tree1bfc0b3d4f987e69b16cb35dfc3dedf9ab288b1b
parentda8f2e170ea94cc20f8ebbc8ee8d127edb8f12f1 (diff)
hrtimer: incorporate feedback from Peter Zijlstra
(based on lkml review) * use rt_task() * task_nice() has a sign Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
-rw-r--r--fs/select.c5
-rw-r--r--include/linux/hrtimer.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/fs/select.c b/fs/select.c
index 5e61b43d0766..fdd8584e536d 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -46,7 +46,7 @@ static unsigned long __estimate_accuracy(struct timespec *tv)
46 unsigned long slack; 46 unsigned long slack;
47 int divfactor = 1000; 47 int divfactor = 1000;
48 48
49 if (task_nice(current)) 49 if (task_nice(current) > 0)
50 divfactor = divfactor / 5; 50 divfactor = divfactor / 5;
51 51
52 slack = tv->tv_nsec / divfactor; 52 slack = tv->tv_nsec / divfactor;
@@ -66,8 +66,7 @@ static unsigned long estimate_accuracy(struct timespec *tv)
66 * Realtime tasks get a slack of 0 for obvious reasons. 66 * Realtime tasks get a slack of 0 for obvious reasons.
67 */ 67 */
68 68
69 if (current->policy == SCHED_FIFO || 69 if (rt_task(current))
70 current->policy == SCHED_RR)
71 return 0; 70 return 0;
72 71
73 ktime_get_ts(&now); 72 ktime_get_ts(&now);
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 1c0473e8ecb4..95db11f62ff2 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -363,7 +363,7 @@ static inline int hrtimer_start_expires(struct hrtimer *timer,
363 soft = hrtimer_get_softexpires(timer); 363 soft = hrtimer_get_softexpires(timer);
364 hard = hrtimer_get_expires(timer); 364 hard = hrtimer_get_expires(timer);
365 delta = ktime_to_ns(ktime_sub(hard, soft)); 365 delta = ktime_to_ns(ktime_sub(hard, soft));
366 return hrtimer_start_range_ns(timer, hrtimer_get_expires(timer), delta, mode); 366 return hrtimer_start_range_ns(timer, soft, delta, mode);
367} 367}
368 368
369static inline int hrtimer_restart(struct hrtimer *timer) 369static inline int hrtimer_restart(struct hrtimer *timer)