[Mesa-dev] [PATCH v3 8/8] anv: Do relocations in userspace before execbuf ioctl

Chris Wilson chris at chris-wilson.co.uk
Fri Nov 4 08:49:18 UTC 2016


On Thu, Nov 03, 2016 at 09:07:55PM -0700, Jason Ekstrand wrote:
>    On Thu, Nov 3, 2016 at 3:00 PM, Chris Wilson <[1]chris at chris-wilson.co.uk>
>    wrote:
> 
>      As it stands today, using NO_RELOC without PINNED, the kernel will
>      arbitrarily assign an address to each buffer. (The kernel doesn't move
>      objects unless it has to, so that address is likely to match the last
>      execbuf, and indeed guaranteed if it is still active.) If all the
>      addresses the kernel choose match the addresses you pass in
>      execobject[].offset, it will skip all the relocations. So it works best
>      when passing back the offset from the previous execbuf.
> 
>    Are you sure it actually checks execobject[].offset?  I haven't been able
>    to find that check anywhere in the code except for one check that's
>    guarded by PINNED.  Also, I've gotten hangs (presumably because the kernel
>    didn't relocate) when I passed NO_RELOC with offsets that didn't match the
>    last execbuf2.

Yes, pretty sure...

i915_gem_execbuffer_reserve_vma (called for every execobject):

	if (entry->offset != vma->node.start) {
		entry->offset = vma->node.start;
		*need_reloc = true;
	}

Oh well, I know what else I'm doing today.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list