From: Ben Widawsky <ben@bwidawsk.net>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 18/29] drm/i915: Use new bind/unbind in eviction code
Date: Tue, 6 Aug 2013 15:57:12 -0700 [thread overview]
Message-ID: <20130806225711.GC2462@bwidawsk.net> (raw)
In-Reply-To: <20130806212949.GO22035@phenom.ffwll.local>
On Tue, Aug 06, 2013 at 11:29:49PM +0200, Daniel Vetter wrote:
> On Tue, Aug 06, 2013 at 02:27:39PM -0700, Ben Widawsky wrote:
> > On Tue, Aug 06, 2013 at 08:39:50PM +0200, Daniel Vetter wrote:
> > > On Wed, Jul 31, 2013 at 05:00:11PM -0700, Ben Widawsky wrote:
> > > > @@ -183,9 +186,11 @@ i915_gem_evict_everything(struct drm_device *dev)
> > > > i915_gem_retire_requests(dev);
> > > >
> > > > /* Having flushed everything, unbind() should never raise an error */
> > > > - list_for_each_entry_safe(obj, next, &vm->inactive_list, mm_list)
> > > > - if (obj->pin_count == 0)
> > > > - WARN_ON(i915_gem_object_ggtt_unbind(obj));
> > > > + list_for_each_entry(vm, &dev_priv->vm_list, global_link) {
> > > > + list_for_each_entry_safe(obj, next, &vm->inactive_list, mm_list)
> > > > + if (obj->pin_count == 0)
> > > > + WARN_ON(i915_vma_unbind(i915_gem_obj_to_vma(obj, vm)));
> > > > + }
> > >
> > > The conversion of evict_everything looks a bit strange. Essentially we
> > > have tree callers:
> > > - ums+gem support code in leavevt to rid the gtt of all gem objects when
> > > the userspace X ums ddx stops controlling the hw.
> > > - When we seriously ran out of memory in, shrink_all.
> > > - In execbuf when we've fragmented the gtt address space so badly that we
> > > need to start over completely fresh.
> > >
> > > With this it imo would make sense to just loop over the global bound
> > > object lists. But for the execbuf caller adding a vm parameter (and only
> > > evicting from that special vm, skipping all others) would make sense.
> > > Other callers would pass NULL since they want everything to get evicted.
> > > Volunteered for that follow-up?
> > >
> >
> > We need evict_everything for #1. For #2, we call evict_something already
> > for the vm when we go through the out of space path. If that failed,
> > evicting everything for a specific VM is just the same operation. But
> > maybe I've glossed over something in the details. Please correct if I'm
> > wrong. Is there a case where evict something might fail with ENOSPC, and
> > evict everything in a VM would help?
>
> Yes, when we've terminally fragmented the gtt we kick out everything and
> start over. That's the 3rd usecase.
> -Daniel
I am not seeing it. To me evict_something is what you want, and the fix
for wherever the 3rd usecase is (please point it out, I'm dense) is it
should call evict_something, not evict_everything.
If by GTT you mean the aperture... that's kind of a different can of
worms completely. In that case I don't think you want to do anything per
VM, though potentially you can do it that way and be a little fairer.
--
Ben Widawsky, Intel Open Source Technology Center
next prev parent reply other threads:[~2013-08-06 22:57 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 23:59 [PATCH 00/29] Completion of i915 VMAs v2 Ben Widawsky
2013-07-31 23:59 ` [PATCH 01/29] drm/i915: Create an init vm Ben Widawsky
2013-07-31 23:59 ` [PATCH 02/29] drm/i915: Rework drop caches for checkpatch Ben Widawsky
2013-08-03 11:32 ` Chris Wilson
2013-08-03 22:10 ` Ben Widawsky
2013-07-31 23:59 ` [PATCH 03/29] drm/i915: Make proper functions for VMs Ben Widawsky
2013-07-31 23:59 ` [PATCH 04/29] drm/i915: Use bound list for inactive shrink Ben Widawsky
2013-07-31 23:59 ` [PATCH 05/29] drm/i915: Add VM to pin Ben Widawsky
2013-07-31 23:59 ` [PATCH 06/29] drm/i915: Use ggtt_vm to save some typing Ben Widawsky
2013-08-01 0:00 ` [PATCH 07/29] drm/i915: Update describe_obj Ben Widawsky
2013-08-01 0:00 ` [PATCH 08/29] drm/i915: Rework __i915_gem_shrink Ben Widawsky
2013-08-05 8:59 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 09/29] drm/i915: thread address space through execbuf Ben Widawsky
2013-08-05 9:39 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 10/29] drm/i915: make caching operate on all address spaces Ben Widawsky
2013-08-05 9:41 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 11/29] drm/i915: BUG_ON put_pages later Ben Widawsky
2013-08-05 9:42 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 12/29] drm/i915: make reset&hangcheck code VM aware Ben Widawsky
2013-08-01 0:00 ` [PATCH 13/29] drm/i915: clear domains for all objects on reset Ben Widawsky
2013-08-03 10:59 ` Chris Wilson
2013-08-03 22:24 ` Ben Widawsky
2013-08-05 9:52 ` Daniel Vetter
2013-08-05 16:46 ` [PATCH 13/29] drm/i915: eliminate dead domain clearing " Ben Widawsky
2013-08-05 17:13 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 14/29] drm/i915: Restore PDEs on gtt restore Ben Widawsky
2013-08-06 18:14 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 15/29] drm/i915: Improve VMA comments Ben Widawsky
2013-08-01 0:00 ` [PATCH 16/29] drm/i915: Cleanup more of VMA in destroy Ben Widawsky
2013-08-01 0:00 ` [PATCH 17/29] drm/i915: plumb VM into bind/unbind code Ben Widawsky
2013-08-06 18:29 ` Daniel Vetter
2013-08-06 18:54 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 18/29] drm/i915: Use new bind/unbind in eviction code Ben Widawsky
2013-08-06 18:39 ` Daniel Vetter
2013-08-06 21:27 ` Ben Widawsky
2013-08-06 21:29 ` Daniel Vetter
2013-08-06 22:57 ` Ben Widawsky [this message]
2013-08-06 22:59 ` Daniel Vetter
2013-08-06 23:25 ` Ben Widawsky
2013-08-06 23:44 ` Daniel Vetter
2013-08-07 18:24 ` Ben Widawsky
2013-08-01 0:00 ` [PATCH 19/29] drm/i915: turn bound_ggtt checks to bound_any Ben Widawsky
2013-08-03 11:03 ` Chris Wilson
2013-08-03 22:26 ` Ben Widawsky
2013-08-06 18:43 ` Daniel Vetter
2013-08-06 21:29 ` Ben Widawsky
2013-08-01 0:00 ` [PATCH 20/29] drm/i915: Fix up map and fenceable for VMA Ben Widawsky
2013-08-06 19:11 ` Daniel Vetter
2013-08-07 18:37 ` Ben Widawsky
2013-08-07 20:32 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 21/29] drm/i915: mm_list is per VMA Ben Widawsky
2013-08-06 19:38 ` Daniel Vetter
2013-08-07 0:28 ` Ben Widawsky
2013-08-07 20:52 ` Daniel Vetter
2013-08-08 4:32 ` Ben Widawsky
2013-08-08 6:46 ` Daniel Vetter
2013-08-08 18:10 ` Ben Widawsky
2013-08-01 0:00 ` [PATCH 22/29] drm/i915: Update error capture for VMs Ben Widawsky
2013-08-01 0:00 ` [PATCH 23/29] drm/i915: Add vma to list at creation Ben Widawsky
2013-08-01 0:00 ` [PATCH 24/29] drm/i915: create vmas at execbuf Ben Widawsky
2013-08-07 20:52 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 25/29] drm/i915: Convert execbuf code to use vmas Ben Widawsky
2013-08-06 20:43 ` Daniel Vetter
2013-08-06 20:45 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 26/29] drm/i915: Convert active API to VMA Ben Widawsky
2013-08-06 20:47 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 27/29] drm/i915: Add bind/unbind object functions to VM Ben Widawsky
2013-08-01 0:00 ` [PATCH 28/29] drm/i915: Use the new vm [un]bind functions Ben Widawsky
2013-08-06 20:58 ` Daniel Vetter
2013-08-01 0:00 ` [PATCH 29/29] drm/i915: eliminate vm->insert_entries() 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=20130806225711.GC2462@bwidawsk.net \
--to=ben@bwidawsk.net \
--cc=daniel@ffwll.ch \
--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