From: Thomas Hellstrom <thellstrom@vmware.com>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 06/16] drm: Protect the master management with a drm_device::master_mutex v2
Date: Fri, 28 Mar 2014 10:45:17 +0100 [thread overview]
Message-ID: <533544AD.80506@vmware.com> (raw)
In-Reply-To: <CANq1E4TvChke-bS2q8qoQEQ6_k=VuMzp96fAkWi0EVUy6nmnsQ@mail.gmail.com>
On 03/28/2014 01:19 AM, David Herrmann wrote:
> Hi
>
>
>
> I also don't quite understand why you move the struct_mutex locking
> into drm_master_destroy() instead of requiring callers to lock it as
> before? I mean, the whole function is protected by the lock..
Before, struct_mutex was required outside of drm_master_put(), because
the argument to drm_master_put was
also protected by struct_mutex. Now that's no longer the case and I
chose to move the locking into the destructor, avoiding a
number of unnecessary struct_mutex locks (the master destructor is
called more seldom than master_put()).
Also in general I believe one should avoid locking around unreferencing
if possible, because it leads to ugly constructs (and even static code
analyzers complaining) if the lock has to be temporarily released in the
destructor to avoid locking order violations.
But in the end I guess that's really a matter of taste.
/Thomas
next prev parent reply other threads:[~2014-03-28 9:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-27 20:23 [PATCH 00/16] vmwgfx render-node support v2 Thomas Hellstrom
2014-03-27 20:23 ` [PATCH 04/16] drm: Improve on minor type helpers v3 Thomas Hellstrom
2014-03-27 20:23 ` [PATCH 06/16] drm: Protect the master management with a drm_device::master_mutex v2 Thomas Hellstrom
2014-03-28 0:19 ` David Herrmann
2014-03-28 8:08 ` Thomas Hellstrom
2014-03-28 8:57 ` Thomas Hellstrom
2014-03-28 9:45 ` Thomas Hellstrom [this message]
2014-03-27 20:23 ` [PATCH 12/16] drm/vmwgfx: Tighten security around surface sharing v2 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=533544AD.80506@vmware.com \
--to=thellstrom@vmware.com \
--cc=dh.herrmann@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.