mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC][PATCH] ipc: mqueue: wq_add priority changed to dynamic priority
@ 2017-12-11 15:37 Jonathan Haws
  2017-12-11 17:12 ` Jonathan Haws
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Haws @ 2017-12-11 15:37 UTC (permalink / raw)
  To: mingo, viro, arnd, akpm, deepa.kernel
  Cc: linux-kernel, tglx, bigeasy, rostedt, Jonathan Haws

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.

Signed-off-by: Jonathan Haws <jhaws@sdl.usu.edu>
---
 ipc/mqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 9649ecd..cb96db9 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -546,7 +546,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);
 			return;
 		}
-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-11 20:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-11 15:37 [RFC][PATCH] ipc: mqueue: wq_add priority changed to dynamic priority Jonathan Haws
2017-12-11 17:12 ` Jonathan Haws
2017-12-11 19:32   ` Steven Rostedt
2017-12-11 19:54     ` Jonathan Haws
2017-12-11 20:15       ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®