aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_rt.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-03-05 16:42:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:33 -0500
commit78d7d407b62a021e6d2e8dc24c0b90e390ab58a1 (patch)
tree8c1074b84db4b977bad6802a3701e0113c0a7739 /kernel/sched_rt.c
parentd4bb527438b4181cd3c564ae04dd344c381283a1 (diff)
kernel core: use helpers for rlimits
Make sure compiler won't do weird things with limits. E.g. fetching them twice may return 2 different values after writable limits are implemented. I.e. either use rlimit helpers added in commit 3e10e716abf3 ("resource: add helpers for fetching rlimits") or ACCESS_ONCE if not applicable. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: john stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r--kernel/sched_rt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index bf3e38fdbe6d..5a6ed1f0990a 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1662,8 +1662,9 @@ static void watchdog(struct rq *rq, struct task_struct *p)
1662 if (!p->signal) 1662 if (!p->signal)
1663 return; 1663 return;
1664 1664
1665 soft = p->signal->rlim[RLIMIT_RTTIME].rlim_cur; 1665 /* max may change after cur was read, this will be fixed next tick */
1666 hard = p->signal->rlim[RLIMIT_RTTIME].rlim_max; 1666 soft = task_rlimit(p, RLIMIT_RTTIME);
1667 hard = task_rlimit_max(p, RLIMIT_RTTIME);
1667 1668
1668 if (soft != RLIM_INFINITY) { 1669 if (soft != RLIM_INFINITY) {
1669 unsigned long next; 1670 unsigned long next;