diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:18:50 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:20:13 -0400 |
commit | 13e68a73175041c83713fd1905c65fe612f73862 (patch) | |
tree | be3edeaac8b1b34714dd75d54d17f1ec88ecac35 /kernel/locking/mutex.c | |
parent | e82bc71470695e6a8a319962737b4abff85bf0c6 (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/locking/mutex.c')
-rw-r--r-- | kernel/locking/mutex.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c index 4cccea6b8934..a8546e29671e 100644 --- a/kernel/locking/mutex.c +++ b/kernel/locking/mutex.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/debug_locks.h> | 27 | #include <linux/debug_locks.h> |
28 | #include <linux/osq_lock.h> | 28 | #include <linux/osq_lock.h> |
29 | 29 | ||
30 | #include <litmus/litmus.h> /* for is_realtime() */ | ||
31 | |||
30 | /* | 32 | /* |
31 | * In the DEBUG case we are using the "NULL fastpath" for mutexes, | 33 | * In the DEBUG case we are using the "NULL fastpath" for mutexes, |
32 | * which forces all calls into the slowpath: | 34 | * which forces all calls into the slowpath: |
@@ -368,7 +370,7 @@ static bool mutex_optimistic_spin(struct mutex *lock, | |||
368 | * we're an RT task that will live-lock because we won't let | 370 | * we're an RT task that will live-lock because we won't let |
369 | * the owner complete. | 371 | * the owner complete. |
370 | */ | 372 | */ |
371 | if (!owner && (need_resched() || rt_task(task))) | 373 | if (!owner && (need_resched() || rt_task(task) || is_realtime(task))) |
372 | break; | 374 | break; |
373 | 375 | ||
374 | /* | 376 | /* |