public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 00/18] dev->struct_mutex crusade
Date: Mon, 10 Aug 2015 13:56:56 +0200	[thread overview]
Message-ID: <20150810115654.GW1262@ulmo.nvidia.com> (raw)
In-Reply-To: <20150810115323.GE11040@nuc-i3427.alporthouse.com>


[-- Attachment #1.1: Type: text/plain, Size: 2361 bytes --]

On Mon, Aug 10, 2015 at 12:53:23PM +0100, Chris Wilson wrote:
> On Mon, Aug 10, 2015 at 01:35:58PM +0200, Thierry Reding wrote:
> > On Thu, Jul 09, 2015 at 11:32:32PM +0200, Daniel Vetter wrote:
> > > Hi all,
> > > 
> > > I wanted to take another look at struct_mutex usage in modern (gem) drivers and
> > > noticed that for a fair lot we're very to be completely struct_mutex free.
> > > 
> > > This pile here is the the simple part, which mostly just removes code and
> > > mutex_lock/unlock calls. All the patches here are independent and can be merged
> > > in any order whatsoever. My plan is to send out a pull request for all those not
> > > picked up by driver maintainers in 2-3 weeks or so, assuming no one complains.
> > > 
> > > Of course review & comments still very much welcome.
> > > 
> > > The more tricky 2nd part of this (and that one's not yet done) is to rework the
> > > gem mmap handler to use the same kref_get_unless_zero trick as ttm. With that
> > > there's no core requirement to hold struct_mutex over the final unref, which
> > > means we can make that one lockless. I plan to add a gem_object_free_unlocked
> > > for all the drivers which don't have any need for this lock.
> > > 
> > > Also there's a few more drivers which can be made struct_mutex free easily, I'll
> > > propably stitch together poc patches for those.
> > 
> > There's a concurrency bug in Tegra DRM currently because we don't lock
> > accesses to drm_mm (I guess this demonstrates how badly we need better
> > testing...) and it seems like this is typically protected by the very
> > same struct_mutex that you're on a crusade to remove. If your goal is
> > to get rid of it for good, should we simply add a separate lock just
> > for the drm_mm? We don't have another one that would fit.
> 
> Actually that is one of the first targets for more fine-grained locking.
> I would not add a new lock to drm_mm as at least for i915, we want to use
> a similar per-vm lock (of which the drm_mm is just one part).

Sorry if I was being unclear. I wasn't suggesting adding the lock to
struct drm_mm, but rather add a driver-specific one specifically to
serialize accesses to the drm_mm. I agree that it's better to do this
in a driver-specific way because other structures may need to be
protected by the same lock.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-08-10 11:56 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 21:32 [PATCH 00/18] dev->struct_mutex crusade Daniel Vetter
2015-07-09 21:32 ` [PATCH 01/18] drm/gem: rip out drm vma accounting for gem mmaps Daniel Vetter
2015-07-11 21:11   ` Chris Wilson
2015-07-14 10:21     ` Daniel Vetter
2015-08-10 11:32   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 02/18] drm/cma-helper: Fix locking in drm_fb_cma_debugfs_show Daniel Vetter
2015-08-10 10:41   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 03/18] drm/gem: Be more friendly with locking checks Daniel Vetter
2015-08-10 10:42   ` Thierry Reding
2015-08-10 11:43     ` Daniel Vetter
2015-07-09 21:32 ` [PATCH 04/18] drm/ast: Don't grab dev->struct_mutex for in mmap offset ioctl Daniel Vetter
2015-08-10 10:46   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 05/18] drm/bochs: " Daniel Vetter
2015-08-10 10:45   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 06/18] drm/mga200g: " Daniel Vetter
2015-08-10 10:46   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 07/18] drm/mga200g: Hold a proper reference for cursor_set Daniel Vetter
2015-08-10 10:46   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 08/18] drm/cirrus: Don't grab dev->struct_mutex for in mmap offset ioctl Daniel Vetter
2015-08-10 10:53   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 09/18] drm/cma-helper: " Daniel Vetter
2015-08-10 10:54   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 10/18] drm/rockchip: " Daniel Vetter
2015-08-10 10:58   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 11/18] drm/armada: " Daniel Vetter
2015-08-10 10:59   ` Thierry Reding
2015-08-10 11:15   ` Russell King - ARM Linux
2015-07-09 21:32 ` [PATCH 12/18] drm/nouveau: Don't take dev->struct_mutex in fbcon init Daniel Vetter
2015-08-10 10:59   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 13/18] drm/nouveau: Don't take dev->struct_mutex in ttm_fini Daniel Vetter
2015-08-10 10:59   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 14/18] drm/qxl: Don't take dev->struct_mutex in bo_force_delete Daniel Vetter
2015-08-10 10:59   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 15/18] drm/radeon: " Daniel Vetter
2015-08-10 11:00   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 16/18] drm/radeon: Don't take dev->struct_mutex in pm functions Daniel Vetter
2015-08-10 11:00   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 17/18] drm/amdgpu: Don't take dev->struct_mutex in bo_force_delete Daniel Vetter
2015-08-10 10:53   ` Thierry Reding
2015-07-09 21:32 ` [PATCH 18/18] drm/amdgpu: don't grab dev->struct_mutex in pm functions Daniel Vetter
2015-07-10  0:20   ` shuang.he
2015-08-10 11:00   ` Thierry Reding
2015-07-15 13:38 ` [PATCH 1/2] drm/tegra: don't take dev->struct_mutex in mmap offset ioctl Daniel Vetter
2015-07-15 13:38   ` [PATCH 2/2] drm/tegra: Use drm_gem_object_reference_unlocked Daniel Vetter
2015-07-19 10:43     ` shuang.he
2015-08-10 10:30   ` [PATCH 1/2] drm/tegra: don't take dev->struct_mutex in mmap offset ioctl Thierry Reding
2015-08-10 11:31     ` Daniel Vetter
2015-08-10 11:38       ` Thierry Reding
2015-08-10 11:35 ` [PATCH 00/18] dev->struct_mutex crusade Thierry Reding
2015-08-10 11:53   ` Chris Wilson
2015-08-10 11:56     ` Thierry Reding [this message]
2015-08-10 12:00   ` Daniel Vetter

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=20150810115654.GW1262@ulmo.nvidia.com \
    --to=thierry.reding@gmail.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --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