path: root/ipc/mqueue.c
diff options
authorJonathan Haws <>2018-02-06 15:40:52 -0800
committerLinus Torvalds <>2018-02-06 18:32:46 -0800
commit68e34f4e89e2bb64d53e77a18e0cfddc3c7f24e9 (patch)
tree8628a36807be17320514021365ba5c703f0b3cf6 /ipc/mqueue.c
parent87ad4b0d853e8a65d6002f4e7bd3dce4ae3a52da (diff)
ipc/mqueue.c: have RT tasks queue in by priority in wq_add()
Previous behavior added tasks to the work queue using the static_prio value instead of the dynamic priority value in prio. This caused RT tasks to be added to the work queue in a FIFO manner rather than by priority. Normal tasks were handled by priority. This fix utilizes the dynamic priority of the task to ensure that both RT and normal tasks are added to the work queue in priority order. Utilizing the dynamic priority (prio) rather than the base priority (normal_prio) was chosen to ensure that if a task had a boosted priority when it was added to the work queue, it would be woken sooner to to ensure that it releases any other locks it may be holding in a more timely manner. It is understood that the task could have a lower priority when it wakes than when it was added to the queue in this (unlikely) case. Link: Signed-off-by: Jonathan Haws <> Reviewed-by: Steven Rostedt (VMware) <> Reviewed-by: Davidlohr Bueso <> Cc: Ingo Molnar <> Cc: Al Viro <> Cc: Arnd Bergmann <> Cc: Deepa Dinamani <> Cc: Thomas Gleixner <> Cc: Sebastian Andrzej Siewior <> Cc: Manfred Spraul <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'ipc/mqueue.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 690ae6665500..360e564ae7d1 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -596,7 +596,7 @@ static void wq_add(struct mqueue_inode_info *info, int sr,
ewp->task = current;
list_for_each_entry(walk, &info->e_wait_q[sr].list, list) {
- if (walk->task->static_prio <= current->static_prio) {
+ if (walk->task->prio <= current->prio) {
list_add_tail(&ewp->list, &walk->list);