[Intel-gfx] [PATCH] drm/i915: Unwind partial VMA rebinding after failure in set-cache-level

Chris Wilson chris at chris-wilson.co.uk
Fri Oct 9 06:10:57 PDT 2015

On Fri, Oct 09, 2015 at 01:37:19PM +0100, Tvrtko Ursulin wrote:
> On 09/10/15 13:19, Chris Wilson wrote:
> >On Fri, Oct 09, 2015 at 01:11:47PM +0100, Tvrtko Ursulin wrote:
> >>
> >>On 09/10/15 12:51, Chris Wilson wrote:
> >>>If the impossible happens and we fail to rebind a VMA in the middle of
> >>>rebinding all VMA for an object we currently bail out and leave the
> >>>object in an inconsistent state. Attempt to unwind the incomplete update
> >>>by reverting all updated VMA back to the original cache-level, and WARN
> >>>if that fails.
> >>
> >>Hey a BUG_ON would have been more your style! ;)
> >
> >Propagating error returns trumps throwing a tantrum and then as we are
> >on the the error path we've already proved the impossible could happen,
> >so presume it could happen again.
> No no, just a BUG_ON(i915_bind_vma()) on the original call site
> would suffice since it cannot happen anyway. ;>
> For the same reason it is safe to skip the current entry when
> reversing I suppose.
> But it is still code to handle something which can't happen. If you
> want to stuff it under future proofing you can have my r-b, but hope
> someone who doesn't like future proofing notices. :)

Maybe I should say nothing is impossible with i915_gem_gtt.c :)

Chris Wilson, Intel Open Source Technology Centre

More information about the Intel-gfx mailing list