From: David Woodhouse <dwmw2@infradead.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH RFC 2/4] drm/i915: IOMMU based SVM implementation v13
Date: Mon, 15 Aug 2016 13:30:11 +0100 [thread overview]
Message-ID: <1471264211.61594.225.camel@infradead.org> (raw)
In-Reply-To: <20160815122351.GG29357@nuc-i3427.alporthouse.com>
[-- Attachment #1.1: Type: text/plain, Size: 1469 bytes --]
On Mon, 2016-08-15 at 13:23 +0100, Chris Wilson wrote:
> On Mon, Aug 15, 2016 at 01:13:25PM +0100, David Woodhouse wrote:
> > On Mon, 2016-08-15 at 13:05 +0100, Chris Wilson wrote:
> > > On Mon, Aug 15, 2016 at 02:48:05PM +0300, Mika Kuoppala wrote:
> > > >
> > > > + struct task_struct *task;
> > >
> > > We don't need the task, we need the mm.
> > >
> > > Holding the task is not sufficient.
> >
> > From the pure DMA point of view, you don't need the MM at all. I handle
> > all that from the IOMMU side so it's none of your business, darling.
>
> But you don't keep the mm alive for the duration of device activity,
> right? And you don't wait for the device to finish before releasing the
> mmu? (iiuc intel-svm.c)
We don't "keep it alive" (i.e. bump mm->mm_users), no.
We *did*, but it caused problems. See commit e57e58bd390a68 for the
gory details.
Now we only bump mm->mm_count so if the process exits, the MM can still
be torn down.
Since exit_mmap() happens before exit_files(), what happens on an
unclean shutdown is that the GPU may start to take faults on the PASID
which is in the process of exiting, before the corresponding file
descriptor gets closed.
So no, we don't wait for the device to finish before releasing the MM.
That would involve calling back into device-driver code from the
mmu_notifier callback, with "interesting" locking constraints. We don't
trust device drivers that much :)
--
dwmw2
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5760 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-08-15 12:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 11:48 [PATCH RFC 0/4] svm support Mika Kuoppala
2016-08-15 11:48 ` [PATCH RFC 1/4] drm/i915: add create_context2 ioctl Mika Kuoppala
2016-08-15 11:55 ` Chris Wilson
2016-08-15 12:25 ` Mika Kuoppala
2016-08-15 12:56 ` Chris Wilson
2016-08-15 16:25 ` Jesse Barnes
2016-08-15 16:36 ` Chris Wilson
2016-08-15 12:03 ` Joonas Lahtinen
2016-08-15 11:48 ` [PATCH RFC 2/4] drm/i915: IOMMU based SVM implementation v13 Mika Kuoppala
2016-08-15 12:05 ` Chris Wilson
2016-08-15 12:13 ` David Woodhouse
2016-08-15 12:23 ` Chris Wilson
2016-08-15 12:30 ` David Woodhouse [this message]
2016-08-15 12:53 ` Chris Wilson
2016-08-15 13:04 ` David Woodhouse
2016-08-15 12:07 ` David Woodhouse
2016-08-15 11:48 ` [PATCH RFC 3/4] drm/i915: add SVM execbuf ioctl v10 Mika Kuoppala
2016-08-15 12:09 ` Chris Wilson
2016-08-15 12:34 ` Mika Kuoppala
2016-08-15 16:26 ` Jesse Barnes
2016-08-17 9:37 ` Joonas Lahtinen
2016-08-17 14:59 ` Jesse Barnes
2016-08-15 11:48 ` [PATCH RFC 4/4] drm/i915: Add param for SVM Mika Kuoppala
2016-08-15 12:11 ` Chris Wilson
2016-08-15 12:22 ` Mika Kuoppala
2016-08-15 12:24 ` ✗ Ro.CI.BAT: failure for svm support Patchwork
2016-08-15 13:43 ` [PATCH RFC 0/4] " 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=1471264211.61594.225.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.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