[PATCH 2/2] drm/amdgpu: report the number of bytes moved at buffer creation
Michel Dänzer
michel at daenzer.net
Thu Feb 9 00:58:50 UTC 2017
On 09/02/17 08:35 AM, Samuel Pitoiset wrote:
> Like ttm_bo_validate(), ttm_bo_init() might need to move BO and
> the number of bytes moved by TTM should be reported. This can help
> the throttle buffer migration mechanism to make a better decision.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
[...]
> @@ -399,10 +400,15 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
> locked = ww_mutex_trylock(&bo->tbo.ttm_resv.lock);
> WARN_ON(!locked);
> }
> +
> + initial_bytes_moved = atomic64_read(&adev->num_bytes_moved);
> r = ttm_bo_init(&adev->mman.bdev, &bo->tbo, size, type,
> &bo->placement, page_align, !kernel, NULL,
> acc_size, sg, resv ? resv : &bo->tbo.ttm_resv,
> &amdgpu_ttm_bo_destroy);
> + amdgpu_cs_report_moved_bytes(adev,
> + initial_bytes_moved - atomic64_read(&adev->num_bytes_moved));
This looks backwards, should be
atomic64_read(&adev->num_bytes_moved) - initial_bytes_moved);
?
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the amd-gfx
mailing list