aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-06-08 12:22:35 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-08-07 03:46:53 -0400
commit0cc482ccaf2efdc8bdb674a67ebe7d36cd06ce39 (patch)
treea08c83494d0fe0e095d2acf5daca527ae78e0cd7 /kernel
parent44bbdeefae36fd3926eeccce4e715d91d5ffe6a0 (diff)
Augment rt_task() with is_realtime()
Whenever the kernel checks for rt_task() to avoid delaying real-time tasks, we want it to also not delay LITMUS^RT tasks. Hence, most calls to rt_task() should be matched by an equivalent call to is_realtime(). Notably, this affects the implementations of select() and nanosleep(), which use timer_slack_ns when setting up timers for non-real-time tasks.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/hrtimer.c3
-rw-r--r--kernel/mutex.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index c7f0c79b2cb5..60b6329ab222 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -49,6 +49,7 @@
49#include <linux/timer.h> 49#include <linux/timer.h>
50 50
51#include <litmus/debug_trace.h> 51#include <litmus/debug_trace.h>
52#include <litmus/litmus.h>
52 53
53#include <asm/uaccess.h> 54#include <asm/uaccess.h>
54 55
@@ -1701,7 +1702,7 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
1701 unsigned long slack; 1702 unsigned long slack;
1702 1703
1703 slack = current->timer_slack_ns; 1704 slack = current->timer_slack_ns;
1704 if (rt_task(current)) 1705 if (rt_task(current) || is_realtime(current))
1705 slack = 0; 1706 slack = 0;
1706 1707
1707 hrtimer_init_on_stack(&t.timer, clockid, mode); 1708 hrtimer_init_on_stack(&t.timer, clockid, mode);
diff --git a/kernel/mutex.c b/kernel/mutex.c
index ad53a664f113..a60d05e9498f 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -25,6 +25,8 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/debug_locks.h> 26#include <linux/debug_locks.h>
27 27
28#include <litmus/litmus.h>
29
28/* 30/*
29 * In the DEBUG case we are using the "NULL fastpath" for mutexes, 31 * In the DEBUG case we are using the "NULL fastpath" for mutexes,
30 * which forces all calls into the slowpath: 32 * which forces all calls into the slowpath:
@@ -325,7 +327,8 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
325 * we're an RT task that will live-lock because we won't let 327 * we're an RT task that will live-lock because we won't let
326 * the owner complete. 328 * the owner complete.
327 */ 329 */
328 if (!owner && (need_resched() || rt_task(task))) 330 if (!owner && (need_resched() ||
331 rt_task(task) || is_realtime(task)))
329 break; 332 break;
330 333
331 /* 334 /*