All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: igt-dev@lists.freedesktop.org, Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 1/3] tests/gem_ctx_shared: Adopt to use allocator
Date: Fri, 20 Aug 2021 08:27:37 +0200	[thread overview]
Message-ID: <20210820062737.GB3286@zkempczy-mobl2> (raw)
In-Reply-To: <87czq87k3n.wl-ashutosh.dixit@intel.com>

On Thu, Aug 19, 2021 at 10:37:00PM -0700, Dixit, Ashutosh wrote:
> On Thu, 19 Aug 2021 21:46:14 -0700, Zbigniew Kempczyński wrote:
> >
> > On Thu, Aug 19, 2021 at 02:16:13PM -0700, Dixit, Ashutosh wrote:
> > > On Wed, 18 Aug 2021 21:49:39 -0700, Zbigniew Kempczyński wrote:
> > > >
> > > > @@ -518,12 +533,24 @@ static void store_dword(int i915, const intel_ctx_t *ctx, unsigned ring,
> > > >
> > > >	memset(obj, 0, sizeof(obj));
> > > >	obj[0].handle = cork;
> > > > -	obj[0].offset = cork << 20;
> > > >	obj[1].handle = target;
> > > > -	obj[1].offset = target << 20;
> > > >	obj[2].handle = gem_create(i915, 4096);
> > > > -	obj[2].offset = 256 << 10;
> > > > -	obj[2].offset += (random() % 128) << 12;
> > > > +	if (ahnd) {
> > > > +		obj[0].offset = cork_offset;
> > > > +		obj[0].flags |= EXEC_OBJECT_PINNED;
> > > > +		obj[1].offset = target_offset;
> > > > +		obj[1].flags |= EXEC_OBJECT_PINNED;
> > > > +		if (write_domain)
> > > > +			obj[1].flags |= EXEC_OBJECT_WRITE;
> > > > +		obj[2].offset = get_offset(ahnd, obj[2].handle, 4096, 0x0);
> > > > +		obj[2].flags |= EXEC_OBJECT_PINNED;
> > > > +		execbuf.flags |= I915_EXEC_NO_RELOC;
> > >
> > > I915_EXEC_NO_RELOC needed (since I think we weren't doing this earlier)?
> >
> > That's minor optimization for softpinning. We got relocation_count == 0 for
> > each gem object, so eb->relocs is empty list. We also don't expect offset
> > change on execbuf return.
> 
> I thought I915_EXEC_NO_RELOC is only needed if we are using relocations, if
> we are softpinning it's not needed?
> 

For softpinning using that flag just ensures you will skip some code
which does nothing (but for example is iterating over buffer list).

Take a look to execbuffer beginning:

	if (DBG_FORCE_RELOC || !(args->flags & I915_EXEC_NO_RELOC))
		args->flags |= __EXEC_HAS_RELOC;

then see two contitionals:
	if (eb->args->flags & __EXEC_HAS_RELOC) {
		...
	}

That code is not executed when NO_RELOC is set giving some small
performance improvement (otherwise it is iterating over buffers to update
offsets if necessary).

--
Zbigniew

  reply	other threads:[~2021-08-20  6:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  4:49 [igt-dev] [PATCH i-g-t 0/3] Adopt to use allocator Zbigniew Kempczyński
2021-08-19  4:49 ` [igt-dev] [PATCH i-g-t 1/3] tests/gem_ctx_shared: " Zbigniew Kempczyński
2021-08-19 21:16   ` Dixit, Ashutosh
2021-08-20  4:46     ` Zbigniew Kempczyński
2021-08-20  5:37       ` Dixit, Ashutosh
2021-08-20  6:27         ` Zbigniew Kempczyński [this message]
2021-08-19  4:49 ` [igt-dev] [PATCH i-g-t 2/3] tests/gem_shrink: Add allocator support Zbigniew Kempczyński
2021-08-19  6:22   ` Zbigniew Kempczyński
2021-08-19  4:49 ` [igt-dev] [PATCH i-g-t 3/3] HAX: remove gttfill for tgl ci Zbigniew Kempczyński
2021-08-19  6:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Adopt to use allocator (rev5) Patchwork
2021-08-19  8:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-08-19  8:35   ` Zbigniew Kempczyński
2021-08-19 16:42     ` Vudum, Lakshminarayana
2021-08-19 16:38 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

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=20210820062737.GB3286@zkempczy-mobl2 \
    --to=zbigniew.kempczynski@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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.