aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtmutex_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rtmutex_common.h')
-rw-r--r--kernel/rtmutex_common.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/rtmutex_common.h b/kernel/rtmutex_common.h
index 97a2f81866af..4df690ca5038 100644
--- a/kernel/rtmutex_common.h
+++ b/kernel/rtmutex_common.h
@@ -129,6 +129,26 @@ extern int rt_mutex_finish_proxy_lock(struct rt_mutex *lock,
129 struct rt_mutex_waiter *waiter, 129 struct rt_mutex_waiter *waiter,
130 int detect_deadlock); 130 int detect_deadlock);
131 131
132
133#define STEAL_LATERAL 1
134#define STEAL_NORMAL 0
135
136/*
137 * Note that RT tasks are excluded from lateral-steals to prevent the
138 * introduction of an unbounded latency
139 */
140static inline int lock_is_stealable(struct task_struct *task,
141 struct task_struct *pendowner, int mode)
142{
143 if (mode == STEAL_NORMAL || rt_task(task)) {
144 if (task->prio >= pendowner->prio)
145 return 0;
146 } else if (task->prio > pendowner->prio)
147 return 0;
148
149 return 1;
150}
151
132#ifdef CONFIG_DEBUG_RT_MUTEXES 152#ifdef CONFIG_DEBUG_RT_MUTEXES
133# include "rtmutex-debug.h" 153# include "rtmutex-debug.h"
134#else 154#else