From: "Christian König" <christian.koenig@amd.com>
To: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: daniel@ffwll.ch, bas@basnieuwenhuizen.nl
Subject: Re: [PATCH 4/6] drm/amdgpu: Remove redundant state change after validation.
Date: Tue, 31 Oct 2023 15:01:00 +0100 [thread overview]
Message-ID: <e8398e2e-696e-416e-bca4-e491f6584ace@amd.com> (raw)
In-Reply-To: <20231031134059.171277-5-ishitatsuyuki@gmail.com>
Am 31.10.23 um 14:40 schrieb Tatsuyuki Ishi:
> All the state changes are handled in the TTM move callback; doing it again
> here just leads to more confusion.
The state move here is because we need to track which PDs/PTs are
already validated and which have new locations reflected in the PDEs.
With this change here you will sooner or later run into PDE corruption.
>
> The table update remains here because it needs to be done exactly once,
> while doing it in the move callback will result it getting triggered twice,
> once by the actual BO and once by the shadow BO.
The table update isn't done in the move callback because you can't take
the appropriate locks there.
Regards,
Christian.
>
> Signed-off-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 01d31891cd05..50f7cee639ac 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -495,12 +495,9 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> return r;
> }
>
> - if (bo->tbo.type != ttm_bo_type_kernel) {
> - amdgpu_vm_bo_moved(bo_base);
> - } else {
> + if (bo->tbo.type == ttm_bo_type_kernel)
> vm->update_funcs->map_table(to_amdgpu_bo_vm(bo));
> - amdgpu_vm_bo_relocated(bo_base);
> - }
> +
> spin_lock(&vm->status_lock);
> }
> spin_unlock(&vm->status_lock);
WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com>
To: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/6] drm/amdgpu: Remove redundant state change after validation.
Date: Tue, 31 Oct 2023 15:01:00 +0100 [thread overview]
Message-ID: <e8398e2e-696e-416e-bca4-e491f6584ace@amd.com> (raw)
In-Reply-To: <20231031134059.171277-5-ishitatsuyuki@gmail.com>
Am 31.10.23 um 14:40 schrieb Tatsuyuki Ishi:
> All the state changes are handled in the TTM move callback; doing it again
> here just leads to more confusion.
The state move here is because we need to track which PDs/PTs are
already validated and which have new locations reflected in the PDEs.
With this change here you will sooner or later run into PDE corruption.
>
> The table update remains here because it needs to be done exactly once,
> while doing it in the move callback will result it getting triggered twice,
> once by the actual BO and once by the shadow BO.
The table update isn't done in the move callback because you can't take
the appropriate locks there.
Regards,
Christian.
>
> Signed-off-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 01d31891cd05..50f7cee639ac 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -495,12 +495,9 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> return r;
> }
>
> - if (bo->tbo.type != ttm_bo_type_kernel) {
> - amdgpu_vm_bo_moved(bo_base);
> - } else {
> + if (bo->tbo.type == ttm_bo_type_kernel)
> vm->update_funcs->map_table(to_amdgpu_bo_vm(bo));
> - amdgpu_vm_bo_relocated(bo_base);
> - }
> +
> spin_lock(&vm->status_lock);
> }
> spin_unlock(&vm->status_lock);
next prev parent reply other threads:[~2023-10-31 14:01 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 13:40 [PATCH 0/6] drm/amdgpu: Add flag to disable implicit sync for GEM operations Tatsuyuki Ishi
2023-10-31 13:40 ` Tatsuyuki Ishi
2023-10-31 13:40 ` [PATCH 1/6] drm/amdgpu: Don't implicit sync PRT maps Tatsuyuki Ishi
2023-10-31 13:40 ` Tatsuyuki Ishi
2023-10-31 13:40 ` [PATCH 2/6] drm/amdgpu: Separate eviction from VM status Tatsuyuki Ishi
2023-10-31 13:40 ` Tatsuyuki Ishi
2023-10-31 13:55 ` Christian König
2023-10-31 13:55 ` Christian König
2023-10-31 14:39 ` Tatsuyuki Ishi
2023-10-31 14:39 ` Tatsuyuki Ishi
2023-10-31 14:44 ` Christian König
2023-10-31 14:44 ` Christian König
2023-10-31 23:52 ` kernel test robot
2023-10-31 23:52 ` kernel test robot
2023-10-31 13:40 ` [PATCH 3/6] drm/amdgpu: Flush VM updates for split bindings eagerly Tatsuyuki Ishi
2023-10-31 13:40 ` Tatsuyuki Ishi
2023-10-31 13:57 ` Christian König
2023-10-31 13:57 ` Christian König
2023-10-31 13:59 ` Bas Nieuwenhuizen
2023-10-31 13:59 ` Bas Nieuwenhuizen
2023-10-31 14:07 ` Christian König
2023-10-31 14:07 ` Christian König
2023-10-31 14:17 ` Bas Nieuwenhuizen
2023-10-31 14:17 ` Bas Nieuwenhuizen
2023-10-31 14:39 ` Tatsuyuki Ishi
2023-10-31 14:39 ` Tatsuyuki Ishi
2023-11-02 2:36 ` Lang Yu
2023-11-02 2:36 ` Lang Yu
2023-11-02 6:41 ` Christian König
2023-11-02 6:41 ` Christian König
2023-11-06 7:56 ` Tatsuyuki Ishi
2023-11-06 7:56 ` Tatsuyuki Ishi
2023-11-06 13:33 ` Christian König
2023-11-06 13:33 ` Christian König
2023-11-01 1:18 ` kernel test robot
2023-11-01 1:18 ` kernel test robot
2023-10-31 13:40 ` [PATCH 4/6] drm/amdgpu: Remove redundant state change after validation Tatsuyuki Ishi
2023-10-31 13:40 ` Tatsuyuki Ishi
2023-10-31 14:01 ` Christian König [this message]
2023-10-31 14:01 ` Christian König
2023-10-31 13:40 ` [PATCH 5/6] drm/amdgpu: Add flag to disable implicit sync for GEM operations Tatsuyuki Ishi
2023-10-31 13:40 ` Tatsuyuki Ishi
2023-10-31 14:14 ` Michel Dänzer
2023-10-31 14:14 ` Michel Dänzer
2023-10-31 14:20 ` Bas Nieuwenhuizen
2023-10-31 14:20 ` Bas Nieuwenhuizen
2023-10-31 14:34 ` Christian König
2023-10-31 14:34 ` Christian König
2023-10-31 14:56 ` Michel Dänzer
2023-10-31 14:56 ` Michel Dänzer
2023-11-01 2:42 ` kernel test robot
2023-11-01 2:42 ` kernel test robot
2023-10-31 13:40 ` [PATCH 6/6] drm/amdgpu: Bump amdgpu driver version Tatsuyuki Ishi
2023-10-31 13:40 ` Tatsuyuki Ishi
2023-11-02 14:04 ` [PATCH v2 0/3] drm/amdgpu: Add flag to disable implicit sync for GEM operations Tatsuyuki Ishi
2023-11-02 14:04 ` Tatsuyuki Ishi
2023-11-02 14:04 ` [PATCH v2 1/3] drm/amdgpu: Don't implicit sync PRT maps Tatsuyuki Ishi
2023-11-02 14:04 ` Tatsuyuki Ishi
2023-11-02 14:04 ` [PATCH v2 2/3] drm/amdgpu: Add flag to disable implicit sync for GEM operations Tatsuyuki Ishi
2023-11-02 14:04 ` Tatsuyuki Ishi
2023-11-06 13:44 ` Christian König
2023-11-06 13:44 ` Christian König
2023-11-06 15:47 ` Tatsuyuki Ishi
2023-11-06 15:47 ` Tatsuyuki Ishi
2023-11-06 19:14 ` Christian König
2023-11-06 19:14 ` Christian König
2023-11-02 14:04 ` [PATCH v2 3/3] drm/amdgpu: Bump amdgpu driver version Tatsuyuki Ishi
2023-11-02 14:04 ` Tatsuyuki Ishi
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=e8398e2e-696e-416e-bca4-e491f6584ace@amd.com \
--to=christian.koenig@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bas@basnieuwenhuizen.nl \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=ishitatsuyuki@gmail.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.