Re: [BUG on PREEMPT_RT, 2.6.23.1-rt5] in rt-mutex code and signals

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Remy Bohmer <linux@...>
Cc: Ingo Molnar <mingo@...>, Thomas Gleixner <tglx@...>, RT <linux-rt-users@...>, linux-kernel <linux-kernel@...>
Date: Friday, November 16, 2007 - 7:37 pm

On Sat, 17 Nov 2007, Remy Bohmer wrote:


The taker of a mutex must also be the one that releases it.  I don't see
how you could use a mutex for this. It really requires some kind of
completion, or a compat_semaphore.


Exactly why it should be a completion or compat semaphores. The reason we
did PI on semaphores is only because they were used as mutexes before Ingo
pushed to actually get a mutex primative into the kernel. Since then,
we've been trying to remove all semaphores with either a mutex or
completion.


        down_interruptible(&dummy);
        printk("We will block now, and if you press CTRL-C from here, we get an OOPS.\n");
        down_interruptible(&dummy);


This double down is actually illegal with rt semaphores. Because we treat
semaphores as mutexes unless they are declared as compat_semaphores. In
which case we don't do PI.

Seems that you need to work out how to use a completion for your code. And
if that doesn't work, then use a compat_semaphore. But beware, that the
compat_semaphore can cause unbounded latencies. But then again, so can
completions.


-- Steve

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [BUG on PREEMPT_RT, 2.6.23.1-rt5] in rt-mutex code and s..., Steven Rostedt, (Fri Nov 16, 7:37 pm)