[PATCH 1/1] amdgpu: va allocation may fall to the range outside of requested [min,max]

Christian König deathsimple at vodafone.de
Wed Jun 29 07:15:12 UTC 2016


Nice catch, the patch looks good to me in general.

You should add a commit message better describing what could go wrong 
here and double check the indentation, looks a bit like you used space 
instead of tabs.

Additional to that you should send the patch as text and not html mail, 
cause that makes it practically impossible to apply.

Regards,
Christian.

Am 29.06.2016 um 07:42 schrieb Wang, Qingqing:
>
> Change-Id: I55e90ae63dd653463817df351050370fc7e896ca
> Signed-off-by: David Mao <david.mao at amd.com>
> ---
>  amdgpu/amdgpu_vamgr.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
> index 82653e9..bc2d302 100644
> --- a/amdgpu/amdgpu_vamgr.c
> +++ b/amdgpu/amdgpu_vamgr.c
> @@ -192,10 +192,14 @@ static uint64_t 
> amdgpu_vamgr_find_va_in_range(struct amdgpu_bo_va_mgr *mgr, uint
>              (hole->offset < range_min && range_min + size > 
> hole->offset + hole->size) ||
>              hole->size < size)
>              continue;
> -        offset = hole->offset;
> +        // it is possible that the hole covers more than one range,
> +        // thus we need to respect the range_min
> +        offset = MAX2(hole->offset, range_min);
>          waste = offset % alignment;
>          waste = waste ? alignment - waste : 0;
>          offset += waste;
> +        // the gap between the range_min and hole->offset need to be 
> covered as well
> +        waste = offset - hole->offset;
>          if (offset >= (hole->offset + hole->size)) {
>              continue;
>          }
> -- 
>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20160629/e14860d7/attachment-0001.html>


More information about the amd-gfx mailing list