All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm: Give the DRM device's anon_inode a unique lockclass for its mmap_rswem
Date: Mon, 11 Dec 2017 17:27:29 +0000	[thread overview]
Message-ID: <151301324978.4445.5328461561747751732@mail.alporthouse.com> (raw)
In-Reply-To: <CAKMK7uHqY_SftqMSync37LxtoWws5ydWq6LT+KLT9H96Mcx8RA@mail.gmail.com>

Quoting Daniel Vetter (2017-12-11 17:20:32)
> On Mon, Dec 11, 2017 at 11:39 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Teach lockdep to track the device's internal mmapping separately
> > from the generic lockclass over all other inodes. Since this is device
> > private we wish to allow a different locking hierarchy than is typified
> > by the requirement for the mmap_rwsem being the outermost lock for
> > handling pagefaults. By giving the internal mmap_rwsem a distinct
> > lockclass, lockdep can identify it and learn/enforce its distinct locking
> > requirements.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104209
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> I think both the commit message and comment are a bit too fluffy - the
> critical bit is that we're biting ourselves on gtt mmaps from
> usersptr, and that's explicitly not allowed exactly because it would
> deadlock.
> 
> I'm also not sure it's a good idea to implement this in generic code,
> since this is a very i915 specific issue, and other drivers (who might
> be a lot less sloppy here) will now no longer get reports about this
> deadlock.

I was thinking that in a more general sense manipulating of the
vma_manager's inode is independent of the processes's mappings. As such
we do not want to tie the two together and force them to conform to the
same rules, because the core mapping semaphore will be held on entry to
driver code, but the internal mapping will be used from within driver
code.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-12-11 17:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 10:39 [PATCH] drm: Give the DRM device's anon_inode a unique lockclass for its mmap_rswem Chris Wilson
2017-12-11 11:58 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-11 13:15 ` ✓ Fi.CI.IGT: " Patchwork
2017-12-11 17:20 ` [PATCH] " Daniel Vetter
2017-12-11 17:27   ` Chris Wilson [this message]
2017-12-11 17:44     ` 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=151301324978.4445.5328461561747751732@mail.alporthouse.com \
    --to=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 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.