[PATCH] drm/gem: Use kref_get_unless_zero for the weak mmap references

2015-10-15 Thread Daniel Vetter
On Thu, Oct 15, 2015 at 01:11:36PM +0200, Daniel Vetter wrote: > On Thu, Oct 15, 2015 at 11:06:59AM +0100, Chris Wilson wrote: > > On Thu, Oct 15, 2015 at 11:33:43AM +0200, Daniel Vetter wrote: > > > Compared to wrapping the final kref_put with dev->struct_mutex this > > > allows us to only acquire

[PATCH] drm/gem: Use kref_get_unless_zero for the weak mmap references

2015-10-15 Thread Daniel Vetter
On Thu, Oct 15, 2015 at 11:06:59AM +0100, Chris Wilson wrote: > On Thu, Oct 15, 2015 at 11:33:43AM +0200, Daniel Vetter wrote: > > Compared to wrapping the final kref_put with dev->struct_mutex this > > allows us to only acquire the offset manager look both in the final > > cleanup and in the looku

[PATCH] drm/gem: Use kref_get_unless_zero for the weak mmap references

2015-10-15 Thread Daniel Vetter
Compared to wrapping the final kref_put with dev->struct_mutex this allows us to only acquire the offset manager look both in the final cleanup and in the lookup. Which has the upside that no locks leak out of the core abstractions. But it means that we need to hold a temporary reference to the obj

[PATCH] drm/gem: Use kref_get_unless_zero for the weak mmap references

2015-10-15 Thread Chris Wilson
On Thu, Oct 15, 2015 at 11:33:43AM +0200, Daniel Vetter wrote: > Compared to wrapping the final kref_put with dev->struct_mutex this > allows us to only acquire the offset manager look both in the final > cleanup and in the lookup. Which has the upside that no locks leak out > of the core abstracti