From: Lang Yu <Lang.Yu@amd.com>
To: Felix Kuehling <felix.kuehling@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Huang Rui <ray.huang@amd.com>,
Christian Koenig <christian.koenig@amd.com>,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/amdkfd: use existing VM helper for PD and PT validation in SVM
Date: Wed, 8 Jun 2022 10:21:57 +0800 [thread overview]
Message-ID: <YqAHxfxEX1bitk96@lang-desktop> (raw)
In-Reply-To: <bed3638b-5b84-e7a4-669e-0c930b66ad60@amd.com>
On 06/07/ , Felix Kuehling wrote:
> Am 2022-06-07 um 05:59 schrieb Lang Yu:
> > This will remove some redundant codes.
> >
> > Signed-off-by: Lang Yu <Lang.Yu@amd.com>
>
> The redundancy is quite small, and amdgpu_amdkfd_gpuvm_validate_pt_pd_bos
> and amdgpu_amdkfd_bo_validate are quite a bit more complex and handle more
> different cases. Someone changing those functions in the future may not
> realize the effect that may have on the SVM code.
>
> I'd prefer to keep the svm_range_bo_validate function in kfd_svm.c to make
> the code easier to understand and maintain. If anything, I'd move it closer
> to where its used, because it's only used in one place.
Thanks for your comments. I got it. By the way,
is it necessary to update vm->pd_phys_addr here?
I noticed that vm->pd_phys_addr is updated in
vm_validate_pt_pd_bos()? Thanks!
Regards,
Lang
> Regards,
> Felix
>
>
> > ---
> > drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 13 +------------
> > 1 file changed, 1 insertion(+), 12 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> > index d6fc00d51c8c..03e07d1d1d1a 100644
> > --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> > @@ -625,15 +625,6 @@ svm_range_get_pdd_by_adev(struct svm_range *prange, struct amdgpu_device *adev)
> > return kfd_process_device_from_gpuidx(p, gpu_idx);
> > }
> > -static int svm_range_bo_validate(void *param, struct amdgpu_bo *bo)
> > -{
> > - struct ttm_operation_ctx ctx = { false, false };
> > -
> > - amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_VRAM);
> > -
> > - return ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
> > -}
> > -
> > static int
> > svm_range_check_attr(struct kfd_process *p,
> > uint32_t nattr, struct kfd_ioctl_svm_attribute *attrs)
> > @@ -1428,9 +1419,7 @@ static int svm_range_reserve_bos(struct svm_validate_context *ctx)
> > goto unreserve_out;
> > }
> > - r = amdgpu_vm_validate_pt_bos(pdd->dev->adev,
> > - drm_priv_to_vm(pdd->drm_priv),
> > - svm_range_bo_validate, NULL);
> > + r = amdgpu_amdkfd_gpuvm_validate_pt_pd_bos(drm_priv_to_vm(pdd->drm_priv));
> > if (r) {
> > pr_debug("failed %d validate pt bos\n", r);
> > goto unreserve_out;
next prev parent reply other threads:[~2022-06-08 2:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-07 9:59 [PATCH 1/3] drm/amdkfd: don't validate pinned BOs Lang Yu
2022-06-07 9:59 ` [PATCH 2/3] drm/amdkfd: simplify PD and PT BOs validation Lang Yu
2022-06-07 9:59 ` [PATCH 3/3] drm/amdkfd: use existing VM helper for PD and PT validation in SVM Lang Yu
2022-06-07 17:02 ` Felix Kuehling
2022-06-08 2:21 ` Lang Yu [this message]
2022-06-08 13:40 ` Felix Kuehling
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=YqAHxfxEX1bitk96@lang-desktop \
--to=lang.yu@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=felix.kuehling@amd.com \
--cc=ray.huang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.