Quoting Chris Wilson (2019-06-03 20:11:30) > Instead of relying on the caller holding struct_mutex across the > allocation, push the allocation under a tree of spinlocks stored inside > the page tables. Not only should this allow us to avoid struct_mutex > here, but it will allow multiple users to lock independent ranges for > concurrent allocations, and operate independently. This is vital for > pushing the GTT manipulation into a background thread where dependency > on struct_mutex is verboten, and for allowing other callers to avoid > struct_mutex altogether. > > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > Cc: Matthew Auld <matthew.auld@xxxxxxxxx> > Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxx> <SNIP> > @@ -1684,9 +1752,7 @@ static void gen6_ppgtt_clear_range(struct i915_address_space *vm, > > num_entries -= count; > > - GEM_BUG_ON(count > pt->used_ptes); This seems to be lost, and it's definitely a valid check, still. With that retained, this is: Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> Operations *_ppgtt_set_* + atomic_inc(used_*) and *_ppgtt_set_*(scratch) + atomic_dec() appear repetitive, but as they're for each different level, a helper might or might not make it cleaner. Regards, Joonas _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx