From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Ben Widawsky <ben@bwidawsk.net>,
Ben Widawsky <benjamin.widawsky@intel.com>,
Intel GFX <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Make vm eviction uninterruptible
Date: Mon, 7 Apr 2014 14:15:00 +0200 [thread overview]
Message-ID: <20140407121500.GE9262@phenom.ffwll.local> (raw)
In-Reply-To: <20140407094256.GI8475@nuc-i3427.alporthouse.com>
On Mon, Apr 07, 2014 at 10:42:56AM +0100, Chris Wilson wrote:
> On Sun, Apr 06, 2014 at 11:35:03AM -0700, Ben Widawsky wrote:
> > On Sat, Apr 05, 2014 at 07:45:28PM -0700, Ben Widawsky wrote:
> > > The issue I was seeing appeared to seeing from sigkill. In such a case,
> > > the process may want to die before the context/work/address space is
> > > freeable. For example:
> > > 1. evict_vm called for whatever reason
> > > 2. wait_seqno because the VMA is still active
> >
> > hmm something isn't right here. Why did I get to wait_seqno if pin_count
> > was 0? Just FYI, this wasn't hypothetical. I did trace it all the way to
> > exactly ERESTARTSYS from wait_seqno.
> >
> > By the way, another option in evict would be:
> > while(ret = (i915_vma_unbind(vma) == -ERESTARTSYS));
> > WARN_ON(ret);
> >
> > > 3. receive signal break out of wait_seqno
> > > 4. return to evict_vm and the above WARN
> > >
> > > Our error handling from there just spirals.
> > >
> > > One issue I have with our current code is I'd really like eviction to
> > > not be able to fail (obviously extreme cases are unavoidable).
>
> This is unrealistic since we must support X which uses sigtimer.
>
> > > Perhaps
> > > one other solution would be to make sure the context is idled before
> > > evicting its VM.
>
> Indeed.
>
> Anyway, I do concur that wrapping i915_driver_preclose() with
>
> dev_priv->mm.interruptible = false;
>
> would make us both happy.
Isn't the backtrace just fallout from the lifetime rules being a bit
funny? We didn't uninterruptibly stall for any still active bo when the
drm fd gets closed, why do we suddenly need to do that with ppgtts? Iirc
requests hold a ref on the context, contexts hold a ref on the ppgtt and
so the entire thing should only dissipate once it's really idle.
Imo just doing uninterruptible sleeps tastes way too much like duct-tape.
I can be convinced of duct-tape if the tradeoffs really strongly suggests
it's the right thing (e.g. the shrinker lock stealing, even though we've
paid a hefty price in accidental complexity with that one), but that needs
some good justification.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-04-07 12:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-05 20:08 [PATCH] drm/i915: Make vm eviction uninterruptible Ben Widawsky
2014-04-05 20:34 ` Chris Wilson
2014-04-06 2:45 ` Ben Widawsky
2014-04-06 18:35 ` Ben Widawsky
2014-04-07 9:42 ` Chris Wilson
2014-04-07 12:15 ` Daniel Vetter [this message]
2014-04-07 12:30 ` Chris Wilson
2014-04-07 18:58 ` Ben Widawsky
2014-04-07 21:50 ` Daniel Vetter
2014-04-07 21:58 ` Ben Widawsky
2014-04-08 6:50 ` Chris Wilson
2014-04-09 4:09 ` Ben Widawsky
2014-04-09 6:16 ` Chris Wilson
2014-04-08 6:53 ` Daniel Vetter
2014-04-09 4:11 ` Ben Widawsky
2014-04-09 12:54 ` Daniel Vetter
2014-04-07 21:17 ` [PATCH] drm/i915: Make vm eviction uninterruptible in preclose Ben Widawsky
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=20140407121500.GE9262@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=ben@bwidawsk.net \
--cc=benjamin.widawsky@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