All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel, Thomas" <thomas.daniel@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>,
	"Goel, Akash" <akash.goel@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v4] drm/i915: Add soft-pinning API for execbuffer
Date: Wed, 15 Jul 2015 15:58:33 +0000	[thread overview]
Message-ID: <BFEE8FEC12424048AF1805991D65FA912EDA7540@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <20150715154643.GK9115@nuc-i3427.alporthouse.com>

> -----Original Message-----
> From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> Sent: Wednesday, July 15, 2015 4:47 PM
> To: Daniel, Thomas
> Cc: Goel, Akash; intel-gfx@lists.freedesktop.org; Belgaumkar, Vinay; Winiarski,
> Michal; Zou, Nanhai
> Subject: Re: [PATCH v4] drm/i915: Add soft-pinning API for execbuffer
> 
> On Wed, Jul 15, 2015 at 03:41:49PM +0000, Daniel, Thomas wrote:
> > > -----Original Message-----
> > > From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> > > Sent: Wednesday, July 15, 2015 4:06 PM
> > > To: Goel, Akash
> > > Cc: Daniel, Thomas; intel-gfx@lists.freedesktop.org; Belgaumkar, Vinay;
> > > Winiarski, Michal; Zou, Nanhai
> > > Subject: Re: [PATCH v4] drm/i915: Add soft-pinning API for execbuffer
> > >
> > > On Wed, Jul 15, 2015 at 08:25:23PM +0530, Goel, Akash wrote:
> > > > >>+int
> > > > >>+i915_gem_evict_for_vma(struct i915_vma *target)
> > > > >>+{
> > > > >>+	struct drm_mm_node *node, *next;
> > > > >>+
> > > > >>+	list_for_each_entry_safe(node, next,
> > > > >>+			&target->vm->mm.head_node.node_list,
> > > > >>+			node_list) {
> > > > >>+		struct i915_vma *vma;
> > > > >>+		int ret;
> > > > >>+
> > > > >>+		if (node->start + node->size <= target->node.start)
> > > > >>+			continue;
> > > > >>+		if (node->start >= target->node.start + target-
> >node.size)
> > > > >>+			break;
> > > > >>+
> > > > >>+		vma = container_of(node, typeof(*vma), node);
> > > > >>+
> > > > >>+		if (vma->pin_count) {
> > > > >>+			/* We may need to evict a buffer in the same
> batch */
> > > > >>+			if (!vma->exec_entry)
> > > > >>+				return -EBUSY;
> > > > >>+
> > > > >>+			if (vma->exec_entry->flags &
> EXEC_OBJECT_PINNED)
> > > > >>+				/* Overlapping fixed objects in the
> same batch
> > > > >>*/
> > > > >>+				return -EINVAL;
> > > > >>+
> > > > >>+			return -ENOSPC;
> > > >
> > > > Can we actually hit this condition, considering the soft pinned
> > > > objects are now on the front side of 'eb->vmas' list ?
> > > > If we do encounter such a case, it probably means that the
> > > > overlapping object is already pinned from some other path.
> > >
> > > Note that softpinned objects are only first on the second pass through
> > > the reservation.
> > Eh?  I modified i915_gem_execbuffer_reserve() to always put the softpinned
> vmas first so they should never collide with objects in the same execbuff.
> 
> That would be a severe performance penalty for the usual case where we
> only have to run once through the list.
How so?  execbuffer_reserve() already traverses the entire vma list and does a list_move or list_move_tail onto ordered_vmas for each entry.  I've simply created a new list for the softpinned vmas and spliced the two together at the end.

> 
> > This contains special stuff which I don't have visibility of (mm.interval_tree,
> vma.active).
> 
> Yes. I mentioned that using softpin introduced some perf regressions.
> -Chris
Can we get your improvements as follow-up patches?

Cheers,
Thomas.


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-15 15:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06  9:44 [PATCH] drm/i915: Add soft-pinning API for execbuffer Chris Wilson
2015-03-11  6:41 ` [Intel-gfx] " Zhenyu Wang
2015-04-29 13:28 ` Daniel, Thomas
2015-04-29 14:01   ` Chris Wilson
2015-06-30 14:13 ` [PATCH v4] " Thomas Daniel
2015-06-30 14:20   ` Daniel, Thomas
2015-07-15 14:55     ` Goel, Akash
2015-07-15 15:06       ` Chris Wilson
2015-07-15 15:41         ` Daniel, Thomas
2015-07-15 15:46           ` Chris Wilson
2015-07-15 15:58             ` Daniel, Thomas [this message]
2015-07-15 16:04               ` Chris Wilson
2015-07-04  5:29   ` Kristian Høgsberg
2015-07-04 12:23     ` Chris Wilson
2015-07-08 15:04       ` Daniel, Thomas
2015-07-08 15:35         ` Chris Wilson
2015-07-04  7:53   ` Chris Wilson
2015-07-20 16:41   ` [PATCH v5] " Thomas Daniel
2015-07-20 16:50     ` Chris Wilson
2015-10-16 10:59     ` [PATCH v6] " Thomas Daniel
2015-10-16 14:09       ` Goel, Akash
2015-10-16 14:15         ` Chris Wilson
2015-12-02 11:28       ` Tvrtko Ursulin
2015-12-02 11:35         ` Chris Wilson
2015-12-08 11:55       ` [PATCH v7] " Thomas Daniel
2015-12-08 18:49         ` Michel Thierry
2015-12-09 10:30           ` Tvrtko Ursulin
2015-12-09 10:51             ` Chris Wilson
2015-12-09 12:34               ` Tvrtko Ursulin
2015-12-09 13:33                 ` Michel Thierry
2015-12-09 13:35                   ` Tvrtko Ursulin
2015-12-09 19:09                     ` Belgaumkar, Vinay

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=BFEE8FEC12424048AF1805991D65FA912EDA7540@irsmsx105.ger.corp.intel.com \
    --to=thomas.daniel@intel.com \
    --cc=akash.goel@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vinay.belgaumkar@intel.com \
    /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.