[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54FD9E71.1050602@linutronix.de>
Date: Mon, 09 Mar 2015 14:21:53 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Mike Galbraith <umgwanakikbuti@...il.com>
CC: Maarten Lankhorst <maarten.lankhorst@...onical.com>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH 2/3] locking: ww_mutex: Allow to use rt_mutex instead
of mutex for the baselock
On 03/09/2015 12:29 PM, Mike Galbraith wrote:
> On Mon, 2015-03-09 at 12:07 +0100, Sebastian Andrzej Siewior wrote:
>> On 03/09/2015 11:51 AM, Mike Galbraith wrote:
>>> Why do both mutex and rtmutex then exist one might ask? ;-) No big deal
>>> either way though, it's not like it becomes immutable once applied.
>>
>> You don't choose rtmutex afaik. rtmutex is used by futex (only?)
>
> Almost only, but not quite.
>
> drivers/media/usb/em28xx/em28xx.h: struct rt_mutex i2c_bus_lock;
> include/linux/i2c.h: struct rt_mutex bus_lock;
> kernel/rcu/tree.h: struct rt_mutex boost_mtx;
So you have two users here: RCU and i2c-bus. The RCU thingy came from
-RT (I think).
and I2C is actually one user. I am not sure Mauro used the rt-mutex in
em28xx for a reason or just blindly copied the i2c code. The i2c-core
holds a bus_lock so I don't think he needs to do the same thing.
And i2c is the other user. It does a try_lock() in "irq_disabled()"
context which records the wrong owner for PI-boosting if it is used
from IRQ context.
I'm not against it but from ww-mutex point it makes most likely sense
to switch them all and not decide which one to switch.
Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists