From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Remove struct_mutex for destroying framebuffers
Date: Wed, 15 Feb 2017 15:59:23 +0200 [thread overview]
Message-ID: <1487167163.8490.41.camel@linux.intel.com> (raw)
In-Reply-To: <20170215105919.7347-1-chris@chris-wilson.co.uk>
On ke, 2017-02-15 at 10:59 +0000, Chris Wilson wrote:
> We do not need to hold struct_mutex for destroying drm_i915_gem_objects
> any longer, and with a little care taken over tracking
> obj->framebuffer_references, we can relinquish BKL locking around the
> destroy of intel_framebuffer.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
<SNIP>
> @@ -14266,14 +14266,14 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>
> static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
> {
> - struct drm_device *dev = fb->dev;
> struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
>
> drm_framebuffer_cleanup(fb);
> - mutex_lock(&dev->struct_mutex);
> - WARN_ON(!intel_fb->obj->framebuffer_references--);
> +
> + WARN_ON(atomic_read(&intel_fb->obj->framebuffer_references) == 0);
> + atomic_dec(&intel_fb->obj->framebuffer_references);
Umm isn't the point of atomicity that you do this in one step?
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-02-15 13:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 10:59 [PATCH 1/3] drm/i915: Remove struct_mutex for destroying framebuffers Chris Wilson
2017-02-15 10:59 ` [PATCH 2/3] drm/i915: struct_mutex is not required for allocating the framebuffer Chris Wilson
2017-02-16 13:55 ` Joonas Lahtinen
2017-02-15 10:59 ` [PATCH 3/3] drm/i915: Drop struct_mutex around frontbuffer flushes Chris Wilson
2017-02-16 13:49 ` Joonas Lahtinen
2017-02-15 13:22 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Remove struct_mutex for destroying framebuffers Patchwork
2017-02-15 13:59 ` Joonas Lahtinen [this message]
2017-02-15 14:09 ` [PATCH 1/3] " Chris Wilson
2017-02-16 9:46 ` [PATCH v2] " Chris Wilson
2017-02-16 10:18 ` Joonas Lahtinen
2017-02-16 14:21 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915: Remove struct_mutex for destroying framebuffers (rev2) Patchwork
2017-02-16 21:55 ` Chris Wilson
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=1487167163.8490.41.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@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