From: "Chen, Xiaogang" <xiaogang.chen@amd.com>
To: Zhigang Luo <Zhigang.Luo@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Hawking.Zhang@amd.com, Sashank.Saye@amd.com,
Jeffrey.Chan@amd.com, philip.yang@amd.com, lijo.lazar@amd.com,
felix.kuehling@amd.com
Subject: Re: [PATCH 1/2] amd/amdkfd: sync all devices to wait all processes being evicted
Date: Tue, 2 Apr 2024 20:31:14 -0500 [thread overview]
Message-ID: <de774146-0253-485b-8572-0c5cee1ceef0@amd.com> (raw)
In-Reply-To: <20240401215349.23361-1-Zhigang.Luo@amd.com>
On 4/1/2024 4:53 PM, Zhigang Luo wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> If there are more than one device doing reset in parallel, the first
> device will call kfd_suspend_all_processes() to evict all processes
> on all devices, this call takes time to finish. other device will
> start reset and recover without waiting. if the process has not been
> evicted before doing recover, it will be restored, then caused page
> fault.
>
> Signed-off-by: Zhigang Luo <Zhigang.Luo@amd.com>
> Change-Id: Ib1eddb56b69ecd41fe703abd169944154f48b0cd
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_device.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> index 041ec3de55e7..55f89c858c7a 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> @@ -969,11 +969,11 @@ void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm)
> if (!run_pm) {
> mutex_lock(&kfd_processes_mutex);
> count = ++kfd_locked;
> - mutex_unlock(&kfd_processes_mutex);
>
> /* For first KFD device suspend all the KFD processes */
> if (count == 1)
> kfd_suspend_all_processes();
> + mutex_unlock(&kfd_processes_mutex);
> }
I do not understand why use kfd_lock here. You want evict all processes
when first device got suspended. The kfd_lock indicates if all kfd
driver functions got locked. It is not same meaning as device suspend.
That is not your patch issue, but I think using different flag to record
device suspend is better. ex, if kfd_lock got set for some other
reasons, we would skip evicting processes here.
Regards
Xiaogang
> for (i = 0; i < kfd->num_nodes; i++) {
> --
> 2.25.1
>
next prev parent reply other threads:[~2024-04-03 1:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 21:53 [PATCH 1/2] amd/amdkfd: sync all devices to wait all processes being evicted Zhigang Luo
2024-04-01 21:53 ` [PATCH 2/2] amd/amdgpu: improve VF recover time Zhigang Luo
2024-04-02 22:32 ` [PATCH 1/2] amd/amdkfd: sync all devices to wait all processes being evicted Felix Kuehling
2024-04-03 1:31 ` Chen, Xiaogang [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-04-03 14:36 Zhigang Luo
2024-04-03 18:12 Zhigang Luo
2024-04-03 19:49 ` 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=de774146-0253-485b-8572-0c5cee1ceef0@amd.com \
--to=xiaogang.chen@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Jeffrey.Chan@amd.com \
--cc=Sashank.Saye@amd.com \
--cc=Zhigang.Luo@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=felix.kuehling@amd.com \
--cc=lijo.lazar@amd.com \
--cc=philip.yang@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