[PATCH 1/2] drm: make idr_mutex a spinlock

Thierry Reding thierry.reding at gmail.com
Fri Aug 29 06:17:30 PDT 2014


On Fri, Aug 29, 2014 at 03:11:19PM +0200, David Herrmann wrote:
> Hi
> 
> On Fri, Aug 29, 2014 at 3:10 PM, Thierry Reding
> <thierry.reding at gmail.com> wrote:
> > On Fri, Aug 29, 2014 at 02:01:00PM +0200, David Herrmann wrote:
> >> There is no reason to use a heavy mutex for idr protection. Use a spinlock
> >> and make idr-allocation use idr_preload().
> >>
> >> This patch also makes mode-object lookup irq-save, in case you ever wanna
> >> lookup modeset objects from interrupts. This is just a side-effect of
> >> avoiding a mutex.
> >
> > I don't think that's entirely accurate. idr_preload(GFP_KERNEL) might
> > sleep since GFP_KERNEL & __GFP_WAIT != 0.
> 
> idr_preload() is only used in registration, not in lookups. Not sure
> what you refer to?

Yes, you're right. I wasn't paying close enough attention and somehow
applied "makes irq-safe" to the "idr_preload()" change without relating
it to "lookup".

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140829/274ccdbf/attachment.sig>


More information about the dri-devel mailing list