From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Clark Subject: Re: [PATCH 06/20] drm/gem: inline drm_gem_object_handle_reference Date: Tue, 23 Jul 2013 08:43:18 -0400 Message-ID: References: <1373958731-4132-1-git-send-email-daniel.vetter@ffwll.ch> <1373958731-4132-7-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 74145E66B4 for ; Tue, 23 Jul 2013 05:43:19 -0700 (PDT) Received: by mail-ob0-f174.google.com with SMTP id wd20so10098917obb.33 for ; Tue, 23 Jul 2013 05:43:19 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: DRI Development List-Id: dri-devel@lists.freedesktop.org On Tue, Jul 23, 2013 at 8:31 AM, Daniel Vetter wrote: > On Tue, Jul 23, 2013 at 2:07 PM, Rob Clark wrote: >> On Tue, Jul 16, 2013 at 3:11 AM, Daniel Vetter 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 BR, -R > -Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch