* [PATCH] drm/i915: Allow objects to go back above 4GB in the address range
@ 2015-12-11 14:34 Michel Thierry
2015-12-11 14:49 ` Chris Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Michel Thierry @ 2015-12-11 14:34 UTC (permalink / raw)
To: intel-gfx
We detected if objects should be moved to the lower parts when 48-bit
support flag was not set, but not the other way around.
This handles the case in which an object was allocated in the 32-bit
address range, but it has been marked as safe to move above it, which
theoretically would help to keep the lower addresses available for
objects which really need to be there.
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
---
drivers/gpu/drm/i915/i915_gem_execbuffer.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 8df5b96..a83916e 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -696,6 +696,11 @@ eb_vma_misplaced(struct i915_vma *vma)
(vma->node.start + vma->node.size - 1) >> 32)
return true;
+ /* keep the lower addresses free of unnecessary objects */
+ if ((entry->flags & EXEC_OBJECT_SUPPORTS_48B_ADDRESS) &&
+ !((vma->node.start + vma->node.size - 1) >> 32))
+ return true;
+
return false;
}
--
2.6.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Allow objects to go back above 4GB in the address range
2015-12-11 14:34 [PATCH] drm/i915: Allow objects to go back above 4GB in the address range Michel Thierry
@ 2015-12-11 14:49 ` Chris Wilson
2015-12-11 18:57 ` Daniel Vetter
0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2015-12-11 14:49 UTC (permalink / raw)
To: Michel Thierry; +Cc: intel-gfx
On Fri, Dec 11, 2015 at 02:34:13PM +0000, Michel Thierry wrote:
> We detected if objects should be moved to the lower parts when 48-bit
> support flag was not set, but not the other way around.
>
> This handles the case in which an object was allocated in the 32-bit
> address range, but it has been marked as safe to move above it, which
> theoretically would help to keep the lower addresses available for
> objects which really need to be there.
>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
No. This is not lazy. When we run out of low space, we evict. Until then
don't cause extra work for no reason.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Allow objects to go back above 4GB in the address range
2015-12-11 14:49 ` Chris Wilson
@ 2015-12-11 18:57 ` Daniel Vetter
2015-12-14 10:18 ` Michel Thierry
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2015-12-11 18:57 UTC (permalink / raw)
To: Chris Wilson, Michel Thierry, intel-gfx
On Fri, Dec 11, 2015 at 02:49:52PM +0000, Chris Wilson wrote:
> On Fri, Dec 11, 2015 at 02:34:13PM +0000, Michel Thierry wrote:
> > We detected if objects should be moved to the lower parts when 48-bit
> > support flag was not set, but not the other way around.
> >
> > This handles the case in which an object was allocated in the 32-bit
> > address range, but it has been marked as safe to move above it, which
> > theoretically would help to keep the lower addresses available for
> > objects which really need to be there.
> >
> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> > Signed-off-by: Michel Thierry <michel.thierry@intel.com>
>
> No. This is not lazy. When we run out of low space, we evict. Until then
> don't cause extra work for no reason.
Yeah, this stuff should just work. First the eviction code should kick
stuff out, and if we totally deadlock then we'll retry with everything
placed nicely. Long-term objects should segregate (assuming you're not
mixing them up badly in the userspace cache).
How did this come up? I think there's a more in-depth story to be shared
here, with some perf data to illustrate it ...
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Allow objects to go back above 4GB in the address range
2015-12-11 18:57 ` Daniel Vetter
@ 2015-12-14 10:18 ` Michel Thierry
2015-12-15 10:53 ` Daniel Vetter
0 siblings, 1 reply; 5+ messages in thread
From: Michel Thierry @ 2015-12-14 10:18 UTC (permalink / raw)
To: Daniel Vetter, Chris Wilson, intel-gfx
On 12/11/2015 6:57 PM, Daniel Vetter wrote:
> On Fri, Dec 11, 2015 at 02:49:52PM +0000, Chris Wilson wrote:
>> On Fri, Dec 11, 2015 at 02:34:13PM +0000, Michel Thierry wrote:
>>> We detected if objects should be moved to the lower parts when 48-bit
>>> support flag was not set, but not the other way around.
>>>
>>> This handles the case in which an object was allocated in the 32-bit
>>> address range, but it has been marked as safe to move above it, which
>>> theoretically would help to keep the lower addresses available for
>>> objects which really need to be there.
>>>
>>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>>> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
>>
>> No. This is not lazy. When we run out of low space, we evict. Until then
>> don't cause extra work for no reason.
>
> Yeah, this stuff should just work. First the eviction code should kick
> stuff out, and if we totally deadlock then we'll retry with everything
> placed nicely. Long-term objects should segregate (assuming you're not
> mixing them up badly in the userspace cache).
>
> How did this come up? I think there's a more in-depth story to be shared
> here, with some perf data to illustrate it ...
Hi,
It came from some local testing; Daniele saw bo's with the support flag
enabled staying in the 32-bit range (the test was changing the flag
between submissions).
If there's no space constraints, re-enabling the flag won't relocate
them, only when evict is required as you said... and that's not really
an issue.
Sorry for the noise.
-Michel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Allow objects to go back above 4GB in the address range
2015-12-14 10:18 ` Michel Thierry
@ 2015-12-15 10:53 ` Daniel Vetter
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2015-12-15 10:53 UTC (permalink / raw)
To: Michel Thierry; +Cc: intel-gfx
On Mon, Dec 14, 2015 at 10:18:02AM +0000, Michel Thierry wrote:
> On 12/11/2015 6:57 PM, Daniel Vetter wrote:
> >On Fri, Dec 11, 2015 at 02:49:52PM +0000, Chris Wilson wrote:
> >>On Fri, Dec 11, 2015 at 02:34:13PM +0000, Michel Thierry wrote:
> >>>We detected if objects should be moved to the lower parts when 48-bit
> >>>support flag was not set, but not the other way around.
> >>>
> >>>This handles the case in which an object was allocated in the 32-bit
> >>>address range, but it has been marked as safe to move above it, which
> >>>theoretically would help to keep the lower addresses available for
> >>>objects which really need to be there.
> >>>
> >>>Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> >>>Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> >>
> >>No. This is not lazy. When we run out of low space, we evict. Until then
> >>don't cause extra work for no reason.
> >
> >Yeah, this stuff should just work. First the eviction code should kick
> >stuff out, and if we totally deadlock then we'll retry with everything
> >placed nicely. Long-term objects should segregate (assuming you're not
> >mixing them up badly in the userspace cache).
> >
> >How did this come up? I think there's a more in-depth story to be shared
> >here, with some perf data to illustrate it ...
>
> Hi,
>
> It came from some local testing; Daniele saw bo's with the support flag
> enabled staying in the 32-bit range (the test was changing the flag between
> submissions).
>
> If there's no space constraints, re-enabling the flag won't relocate them,
> only when evict is required as you said... and that's not really an issue.
Hm, it might make sense for validation to catch userspace bugs where it
mislabels bos wrt 48bit. But then unit tests (at least with mesa/piglit)
destroy the gpu context (well entire executable) for every test, so false
sharing like this shouldn't ever happen and we should be able to catch
issues reliably. So I think we don't need some special debugfs tunable to
kick the kernel into validation mode for this case.
And if you absolutely want it we already have the evict interface to
forcefully throw out everything and provoke fresh bindings. Not cheap, but
should still work for at least validating the logic.
> Sorry for the noise.
No worries, just figured there's a bigger story worth sharing here.
Validation noticing this makes sense.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-12-15 10:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-11 14:34 [PATCH] drm/i915: Allow objects to go back above 4GB in the address range Michel Thierry
2015-12-11 14:49 ` Chris Wilson
2015-12-11 18:57 ` Daniel Vetter
2015-12-14 10:18 ` Michel Thierry
2015-12-15 10:53 ` Daniel Vetter
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.