AMD-GFX Archive mirror
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: "Xiaogang.Chen" <xiaogang.chen@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/kfd: Correct pined buffer handling at kfd restore and validate process
Date: Mon, 13 May 2024 19:17:39 -0400	[thread overview]
Message-ID: <d04abc35-4bd0-4971-aed6-e4f09e1c84ae@amd.com> (raw)
In-Reply-To: <20240513151842.125976-1-xiaogang.chen@amd.com>



On 2024-05-13 11:18, Xiaogang.Chen wrote:
> From: Xiaogang Chen <xiaogang.chen@amd.com>
> 
> This reverts 8a774fe912ff09e39c2d3a3589c729330113f388 "drm/amdgpu: avoid restore
> process run into dead loop" since buffer got pined is not related whether it

Spelling: pined -> pinned

Same in the commit headline.


> needs mapping. And skip buffer validation at kfd driver if the buffer has been
> pinned.
> 
> Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 3314821e4cf3..80018738bd1c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -415,6 +415,10 @@ static int amdgpu_amdkfd_bo_validate(struct amdgpu_bo *bo, uint32_t domain,
>  		 "Called with userptr BO"))
>  		return -EINVAL;
>  
> +	/* bo has been pined, not need validate it */

pined -> pinned

With those typos fixed, the patch is

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>


> +	if (bo->tbo.pin_count)
> +		return 0;
> +
>  	amdgpu_bo_placement_from_domain(bo, domain);
>  
>  	ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
> @@ -2736,7 +2740,7 @@ static int confirm_valid_user_pages_locked(struct amdkfd_process_info *process_i
>  
>  		/* keep mem without hmm range at userptr_inval_list */
>  		if (!mem->range)
> -			 continue;
> +			continue;
>  
>  		/* Only check mem with hmm range associated */
>  		valid = amdgpu_ttm_tt_get_user_pages_done(
> @@ -2981,9 +2985,6 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence __rcu *
>  			if (!attachment->is_mapped)
>  				continue;
>  
> -			if (attachment->bo_va->base.bo->tbo.pin_count)
> -				continue;
> -
>  			kfd_mem_dmaunmap_attachment(mem, attachment);
>  			ret = update_gpuvm_pte(mem, attachment, &sync_obj);
>  			if (ret) {

      reply	other threads:[~2024-05-13 23:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 15:18 [PATCH] drm/kfd: Correct pined buffer handling at kfd restore and validate process Xiaogang.Chen
2024-05-13 23:17 ` Felix Kuehling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d04abc35-4bd0-4971-aed6-e4f09e1c84ae@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=xiaogang.chen@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).