[Mesa-dev] [PATCH 5/9] anv: Add vma_heap allocators in anv_device
Chris Wilson
chris at chris-wilson.co.uk
Wed May 2 16:32:36 UTC 2018
Quoting Scott D Phillips (2018-05-02 17:01:05)
> +bool
> +anv_vma_alloc(struct anv_device *device, struct anv_bo *bo)
> +{
> + if (!(bo->flags & EXEC_OBJECT_PINNED))
> + return true;
> +
> + pthread_mutex_lock(&device->vma_mutex);
> +
> + bo->offset = 0;
So bo are device scoped. There can only be a single vma per bo, so why
not store the vma node inside the bo? No extra allocations, no
searching in anv_vma_close() (a linear walk!!! Granted you have the
excuse of doing a full walk for list validation on top of that).
I guess you don't have much that stresses the vma manager :)
The decision to split low/high ranges rather than have a up/down
allocator wants a few words of explanation.
-Chris
More information about the mesa-dev
mailing list