Re: [PATCH] drm: Avoid drm_global_mutex for simple inc/dec of dev->open_count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Thomas Hellström (VMware) (2020-01-24 13:37:47)
> On 1/24/20 2:01 PM, Chris Wilson wrote:
> > Since drm_global_mutex is a true global mutex across devices, we don't
> > want to acquire it unless absolutely necessary. For maintaining the
> > device local open_count, we can use atomic operations on the counter
> > itself, except when making the transition to/from 0. Here, we tackle the
> > easy portion of delaying acquiring the drm_global_mutex for the final
> > release by using atomic_dec_and_mutex_lock(), leaving the global
> > serialisation across the device opens.
> >
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Thomas Hellström (VMware) <thomas_os@xxxxxxxxxxxx>
> 
> For the series:
> 
> Reviewed-by: Thomas Hellström <thellstrom@xxxxxxxxxx>
> 
> Now the only remaining (though pre-existing) problem I can see is that 
> there is no corresponding mutex lock in drm_open() so that firstopen 
> might race with lastclose.. Or I might be missing something..

iirc, it's a complicated dance where it goes through drm_stub_open()
first which acquires the drm_global_mutex.
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux