dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Dave Airlie <airlied@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Replace kref with a simple atomic reference count
Date: Thu, 25 Nov 2010 22:44:04 +0000	[thread overview]
Message-ID: <5b55a1$ip55t9@fmsmga002.fm.intel.com> (raw)
In-Reply-To: <1290724709.5661.54.camel@clockmaker-el6>

On Fri, 26 Nov 2010 08:38:29 +1000, Dave Airlie <airlied@redhat.com> 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

  reply	other threads:[~2010-11-25 22:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 21:40 [PATCH] drm: Replace kref with a simple atomic reference count Chris Wilson
2010-11-25 22:38 ` Dave Airlie
2010-11-25 22:44   ` Chris Wilson [this message]
2010-11-25 23:13     ` Alan Cox
2010-11-28 12:32   ` Thomas Hellstrom
2010-11-28 13:35     ` Daniel Vetter
2010-11-28 14:19       ` Thomas Hellstrom
2010-11-28 15:13         ` Daniel Vetter
2010-11-28 17:20           ` Thomas Hellstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='5b55a1$ip55t9@fmsmga002.fm.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox