From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm: Replace kref with a simple atomic reference count Date: Thu, 25 Nov 2010 22:44:04 +0000 Message-ID: <5b55a1$ip55t9@fmsmga002.fm.intel.com> References: <1290721205-32433-1-git-send-email-chris@chris-wilson.co.uk> <1290724709.5661.54.camel@clockmaker-el6> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B61F9ED8B for ; Thu, 25 Nov 2010 14:44:07 -0800 (PST) In-Reply-To: <1290724709.5661.54.camel@clockmaker-el6> 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: Dave Airlie Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Fri, 26 Nov 2010 08:38:29 +1000, Dave Airlie wrote: > On Thu, 2010-11-25 at 21:40 +0000, Chris Wilson wrote: > > For a deferred-free cache of unreferenced bound objects, a simple > > reference count is required without the baggage of kref. > > eh? The issue with kref is that it does: void kref_get(struct kref *kref) { WARN_ON(!atomic_read(&kref->refcount)); atomic_inc(&kref->refcount); smp_mb__after_atomic_inc(); } which causes havoc when you are trying to keep a list of unreferenced objects. That's all I'm trying to avoid. -Chris -- Chris Wilson, Intel Open Source Technology Centre