From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@canonical.com>,
linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH 2/3] locking: ww_mutex: Allow to use rt_mutex instead of mutex for the baselock
Date: Mon, 9 Mar 2015 15:27:42 -0700 [thread overview]
Message-ID: <20150309222741.GB5708@linux.vnet.ibm.com> (raw)
In-Reply-To: <54FD9E71.1050602@linutronix.de>
On Mon, Mar 09, 2015 at 02:21:53PM +0100, Sebastian Andrzej Siewior wrote:
> 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).
RCU uses rt_mutex rather than mutex because it needs rt_mutex's
priority-inheritance features for RCU priority boosting. This did
indeed originally come from -rt, but is now in mainline.
If mutex gains rt_mutex's priority-boosting capability, then RCU
could switch to mutex.
But you both probably knew all that already...
Thanx, Paul
> 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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2015-03-09 22:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 16:57 rt_mutex based ww_mutex implementation Sebastian Andrzej Siewior
2015-02-27 16:57 ` [PATCH 1/3] locking: ww_mutex: add one level of indirection for access of the lock Sebastian Andrzej Siewior
2015-02-27 18:20 ` Maarten Lankhorst
2015-02-27 18:57 ` Sebastian Andrzej Siewior
2015-02-27 16:57 ` [PATCH 2/3] locking: ww_mutex: Allow to use rt_mutex instead of mutex for the baselock Sebastian Andrzej Siewior
2015-03-02 3:20 ` Mike Galbraith
2015-03-02 8:46 ` Maarten Lankhorst
2015-03-02 12:50 ` Mike Galbraith
2015-03-06 12:14 ` Sebastian Andrzej Siewior
2015-03-06 12:16 ` Maarten Lankhorst
2015-03-06 12:36 ` Sebastian Andrzej Siewior
2015-03-06 17:50 ` Mike Galbraith
2015-03-09 10:00 ` Sebastian Andrzej Siewior
2015-03-09 10:51 ` Mike Galbraith
2015-03-09 11:07 ` Sebastian Andrzej Siewior
2015-03-09 11:29 ` Mike Galbraith
2015-03-09 13:21 ` Sebastian Andrzej Siewior
2015-03-09 22:27 ` Paul E. McKenney [this message]
2015-03-10 12:30 ` Peter Zijlstra
2015-03-10 12:37 ` Peter Zijlstra
2015-03-10 12:39 ` Peter Zijlstra
2015-03-10 14:10 ` Maarten Lankhorst
2015-03-10 15:28 ` Peter Zijlstra
2015-03-10 18:21 ` Maarten Lankhorst
2015-03-10 12:43 ` Peter Zijlstra
2015-03-10 12:46 ` Peter Zijlstra
2015-02-27 16:57 ` [PATCH 3/3] locking: rtmutex: set state back to running on error Sebastian Andrzej Siewior
2015-02-28 10:00 ` [tip:locking/urgent] locking/rtmutex: Set " tip-bot for Sebastian Andrzej Siewior
2015-03-01 5:35 ` [PATCH 3/3] locking: rtmutex: set " Mike Galbraith
2015-03-01 8:48 ` [tip:locking/urgent] locking/rtmutex: Set " tip-bot for Sebastian Andrzej Siewior
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=20150309222741.GB5708@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@canonical.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=umgwanakikbuti@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.