[Intel-gfx] [PATCH] drm/i915/selftests: Pretty print the i915_active

Chris Wilson chris at chris-wilson.co.uk
Thu Oct 31 14:33:05 UTC 2019


Quoting Chris Wilson (2019-10-31 14:18:56)
> My memory says, and my assumption in this code, is that the
> the iterator is safe against insertions -- we won't get horribly lost if
> the tree is rebalanced as we walk.

Actually, the iterator is not perfect across rebalances. It won't matter
here in the selftest, since we are the only accessor, the two other
users deserve throught.

In __active_retire, we have exclusive access to the tree as we are
freeing the nodes. Safe.

In i915_active_wait() [we can't take the mutex here due to shrinker
inversions!], we walk the tree to kick signaling on the nodes. So the
iterator is not perfect, but calling enable_signaling() is mostly an
optimisation so that we don't have to wait upon the background flush. So
I think we are safe to miss nodes, so long as the iterator itself is
bounded (which it must be).
-Chris


More information about the Intel-gfx mailing list