mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Haws <jhaws@sdl.usu.edu>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCHv2] Fixing POSIX wait queue to insert in task priority order for real-time, including normal tasks
Date: Wed, 6 Dec 2017 01:23:44 +0000	[thread overview]
Message-ID: <1512523423.9445.7.camel@sdl.usu.edu> (raw)
In-Reply-To: <1512522932-10318-1-git-send-email-jhaws@sdl.usu.edu>

Sorry for the initial email - forgot the signed-off-by in my commit.
 Still new to this...

I'd like feedback from the community on this patch.  I've tested this
against my applications that were exhibiting problematic behavior when
tasks would wake up in FIFO order instead of priority order when trying
to write to a POSIX message queue.  Without the patch, multiple RT
tasks waiting to write to a queue wake up in FIFO order (assuming nice
value untouched); with the patch they wake up in priority order (based
on RT priority setting via sched_setparam.

Is this the correct way to remedy this issue?  Using prio here pulls in
the current priority of the task, including boosts from priority
inheritance.  In that case, would normal_prio be more appropriate?

Anyway, if this patch is acceptable then I'd also love some feedback to
know what steps need to be taken from here to push it along.

Thanks!
Jon

> 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;
>  		}

  reply	other threads:[~2017-12-06  1:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06  1:15 Jonathan Haws
2017-12-06  1:23 ` Jonathan Haws [this message]
2017-12-11 14:30 ` Steven Rostedt
2017-12-11 15:13   ` Jonathan Haws
2017-12-11 15:57     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512523423.9445.7.camel@sdl.usu.edu \
    --to=jhaws@sdl.usu.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®