public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Joerg.Abraham@alcatel-lucent.de, linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	linux-rt-users@vger.kernel.org
Subject: Re: 2.6.31.4-rt14 posix message queues problem
Date: Thu, 15 Oct 2009 22:19:16 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0910152217390.3486@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.00.0910152105430.8932@localhost.localdomain>



On Thu, 15 Oct 2009, John Kacur wrote:

> 
> > From: Joerg Abraham <Joerg.Abraham@alcatel-lucent.de>
> > Date: Thu, Oct 15, 2009 at 7:51 PM
> > Subject: 2.6.31.4-rt14 posix message queues problem
> > To: LKML <linux-kernel@vger.kernel.org>
> > 
> > 
> > Hi,
> > 
> > During some performance measurement I stumbled over unexpected bad
> > results for a posix message queue test case. Which is not surprising
> > since the kernel log shows a "BUG: scheduling while atomic:" on every
> > measurement trigger.
> > 
> > Attached is the kernel log for an embedded 8572ds powerpc system and a
> > condensed user space test appli. The test appli uses 2 processes
> > (mq_server and mq_client) and pingpongs some messages via posix
> > message queues. Please see the c-file header for details (the appli
> > itself makes not much sense but shows the problem).
> > 
> > ./mq_server
> > ./mq_client # just crashes during run
> > 
> > The problem does _not_ occur on kernels 2.6.29.6-rt24, 2.6.29.6
> > vanilla and 2.6.31.4 vanilla. The problem does _also_ show up on an
> > embedded x86_64 system and a full featured fc11 x86_64 system running
> > a 2.6.31.4-rt14 based kernel, so I dont think it's arch dependent.
> > 
> > Can anybody reproduce the crash ???
> > 
> > If you need more info's please let me know.
> > 
> > [And if I'm doing stupid things just forgive me]
> > 
> > Thanx
> > 
> > Joerg
> 
> Hello Joerg
> 
> Does the following patch solve your problem? 
> 
> From 69fde4357db4a054733cbca4158606160e821a3a Mon Sep 17 00:00:00 2001
> From: John Kacur <jkacur@redhat.com>
> Date: Thu, 15 Oct 2009 20:52:37 +0200
> Subject: [PATCH] preempt_disable_rt(); should be paired with preempt_enable_rt()
> 
> Signed-off-by: John Kacur <jkacur@redhat.com>
> ---
>  ipc/mqueue.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/ipc/mqueue.c b/ipc/mqueue.c
> index 63a47f7..ab4df36 100644
> --- a/ipc/mqueue.c
> +++ b/ipc/mqueue.c
> @@ -830,7 +830,7 @@ static inline void pipelined_send(struct mqueue_inode_info *info,
>  	wake_up_process(receiver->task);
>  	smp_wmb();
>  	receiver->state = STATE_READY;
> -	preempt_enable_nort();
> +	preempt_enable_rt();
>  }
>  
>  /* pipelined_receive() - if there is task waiting in sys_mq_timedsend()
> -- 
> 1.6.0.6
> 
>
 
fyi: I completed my testing, and  I was able to reproduce your problem on 
v2.6.31.4-rt14, and it goes away with the above patch.

Cheers

John

           reply	other threads:[~2009-10-15 20:19 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <alpine.LFD.2.00.0910152105430.8932@localhost.localdomain>]

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.00.0910152217390.3486@localhost.localdomain \
    --to=jkacur@redhat.com \
    --cc=Joerg.Abraham@alcatel-lucent.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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