[PATCH 06/20] drm/gem: inline drm_gem_object_handle_reference

Dave Airlie airlied at gmail.com
Tue Jul 23 17:00:59 PDT 2013


On Tue, Jul 23, 2013 at 10:43 PM, Rob Clark <robdclark at gmail.com> wrote:
> On Tue, Jul 23, 2013 at 8:31 AM, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
>> On Tue, Jul 23, 2013 at 2:07 PM, Rob Clark <robdclark at gmail.com> wrote:
>>> On Tue, Jul 16, 2013 at 3:11 AM, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
>>>> Only one callsite and since ->handle_count is not a simple reference
>>>> count (it can resurrect) it's imo better to be explicit about things
>>>> than hide the refcount dance.
>>>
>>> I'm not really sure I like this one.. I guess it could be that I'm
>>> just used to the handle-ref stuff, so it doesn't seem odd not-inlined.
>>>  And it does seem kinda odd / unsymmetric to have an unref w/out a
>>> ref.  I guess I kinda like the bikeshed's current color in this case.
>>
>> I generally agree but in this case a follow-up patch ("drm/gem: fix up
>> flink name create race") will change obj->handle_count from an
>> atomic_t to a normal int protected by the dev->object_name_lock
>> spinlock. To avoid races we need to hold that spinlock over a few
>> different instructions, so with the refcounting dance inlined it's
>> much more obvious that that obj->handle_count is always correctly
>> protected imo.
>
> hmm, ok.. then I'll reserve judgment until I get further through the series ;-)
>
> if you do spin another version of the series, it could be worth
> mentioning this in the commit msg
>

Just merge this into that series or patch,

deinlining it now it just noise.

Dave.


More information about the dri-devel mailing list