[Intel-gfx] [PATCH 3/5] drm/i915: Remove node only when allocated

Ben Widawsky ben at bwidawsk.net
Tue Aug 13 03:37:56 CEST 2013


On Sat, Aug 10, 2013 at 09:45:05AM +0100, Chris Wilson wrote:
> On Fri, Aug 09, 2013 at 10:12:14PM -0700, Ben Widawsky wrote:
> > In upcoming code, it will be possible for a vma to have been created,
> > but no space reserved for it in the address space. The drm_mm semantics
> > are such that trying to remove an unallocated node is not allowed.
> 
> But not allocated during unbind, i.e. calling unbind() before bind()?
> That seems scary enough.
> -Chris
> 

The condition can occur if we create a vma, fail to bind it, and then
free up the object (which tries to unbind). As I alluded to, this
cannot happen until we do the execbufer vma creation.

The example for which is can happen is if we have some object created,
with a vma

AFAICT, this condition cannot occur until we actually are using multiple
VMs, but once we are the following can occur:

object X created for context Y
VMA-Y created for object X
VMA-Z created for object X, but fails before or during bind
    VMA-Z persists
object X destroyed
    free calls unbind on all VMAs. VMA-Z has no node allocated for it.

One way to may this better is to not call unbind() if it isn't
allocated, and simply call vma_destroy(). I don't really care. You tell
me what you want.


-- 
Ben Widawsky, Intel Open Source Technology Center



More information about the Intel-gfx mailing list