public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp>
Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	viro@zeniv.linux.org.uk, dchinner@redhat.com, npiggin@kernel.dk,
	hch@lst.de, arnd@arndb.de
Subject: Re: [PATCH 3.0-rt1] ipc/mqueue: add a critical section to avoid a deadlock
Date: Sat, 23 Jul 2011 09:23:37 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1107230923020.2702@ionos> (raw)
In-Reply-To: <4E2A38A0.1090601@toshiba.co.jp>

On Sat, 23 Jul 2011, KOBAYASHI Yoshitake wrote:

> (Repost for v3.0-rt1 and changed the distination addreses)
> I have tested the following patch on v3.0-rt1 with PREEMPT_RT_FULL.
> In POSIX message queue, if a sender process uses SCHED_FIFO and
> has a higher priority than a receiver process, the sender will
> be stuck at ipc/mqueue.c:452
> 
>   452                 while (ewp->state == STATE_PENDING)
>   453                         cpu_relax();
> 
> Description of the problem
>  (receiver process)
>    1. receiver changes sender's state to STATE_PENDING (mqueue.c:846)
>    2. wake up sender process and "switch to sender" (mqueue.c:847)
>       Note: This context switch only happens in PREEMPT_RT_FULL kernel.
>  (sender process)
>    3. sender check the own state in above loop (mqueue.c:452-453)
>    *. receiver will never wake up and cannot change sender's state to
>       STATE_READY because sender has higher priority

Good catch! Queued for -rt2.

Thanks,

	tglx

      reply	other threads:[~2011-07-23  7:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-23  2:57 [PATCH 3.0-rt1] ipc/mqueue: add a critical section to avoid a deadlock KOBAYASHI Yoshitake
2011-07-23  7:23 ` Thomas Gleixner [this message]

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=alpine.LFD.2.02.1107230923020.2702@ionos \
    --to=tglx@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=dchinner@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=npiggin@kernel.dk \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yoshitake.kobayashi@toshiba.co.jp \
    /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