From: "Kuehling, Felix" <felix.kuehling@amd.com>
To: Zhu Lingshan <lingshan.zhu@amd.com>, alexander.deucher@amd.com
Cc: ray.huang@amd.com, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH V4 14/18] amdkfd: record kfd process id into kfd process_info
Date: Wed, 24 Sep 2025 17:45:25 -0400 [thread overview]
Message-ID: <c0997b76-e9ab-4c03-a2ec-16f39de2ee59@amd.com> (raw)
In-Reply-To: <20250923072608.252345-15-lingshan.zhu@amd.com>
On 2025-09-23 03:26, Zhu Lingshan wrote:
> This commit records the id of the owner
> kfd_process into a kfd process_info when
> create it.
>
> Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 2 ++
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++++
> 2 files changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> index aa88bad7416b..d867984a68da 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
> @@ -146,6 +146,8 @@ struct amdkfd_process_info {
> /* MMU-notifier related fields */
> struct mutex notifier_lock;
> uint32_t evicted_bos;
> + /* kfd process id */
> + u16 process_id;
The name "process_id" is a bit misleading. I would prefer something like
"context_id" or "secondary_id" to make it cleare that this identifies
secondary contexts and has nothing to do with the PID. Maybe use the
same name in struct kfd_process as well for clarity.
Regards,
Felix
> struct delayed_work restore_userptr_work;
> struct pid *pid;
> bool block_mmu_notifications;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index b16cce7c22c3..723d34921c12 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -1382,8 +1382,10 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
> struct dma_fence **ef)
> {
> struct amdkfd_process_info *info = NULL;
> + struct kfd_process *process = NULL;
> int ret;
>
> + process = container_of(process_info, struct kfd_process, kgd_process_info);
> if (!*process_info) {
> info = kzalloc(sizeof(*info), GFP_KERNEL);
> if (!info)
> @@ -1410,6 +1412,8 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
> INIT_DELAYED_WORK(&info->restore_userptr_work,
> amdgpu_amdkfd_restore_userptr_worker);
>
> + info->process_id = process->id;
> +
> *process_info = info;
> }
>
next prev parent reply other threads:[~2025-09-24 21:45 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 7:25 [PATCH V4 00/18] amdkfd: Implement kfd multiple contexts Zhu Lingshan
2025-09-23 7:25 ` [PATCH V4 01/18] amdkfd: enlarge the hashtable of kfd_process Zhu Lingshan
2025-09-23 7:25 ` [PATCH V4 02/18] amdkfd: mark the first kfd_process as the primary one Zhu Lingshan
2025-09-23 7:25 ` [PATCH V4 03/18] amdkfd: find_process_by_mm always return the primary context Zhu Lingshan
2025-09-23 7:25 ` [PATCH V4 04/18] amdkfd: Introduce kfd_create_process_sysfs as a separate function Zhu Lingshan
2025-09-23 7:25 ` [PATCH V4 05/18] amdkfd: destroy kfd secondary contexts through fd close Zhu Lingshan
2025-09-23 7:25 ` [PATCH V4 06/18] amdkfd: process svm ioctl only on the primary kfd process Zhu Lingshan
2025-09-23 7:25 ` [PATCH V4 07/18] amdkfd: process USERPTR allocation " Zhu Lingshan
2025-09-23 7:25 ` [PATCH V4 08/18] amdkfd: identify a secondary kfd process by its id Zhu Lingshan
2025-09-24 21:41 ` Kuehling, Felix
2025-09-26 2:58 ` Zhu, Lingshan
2025-09-23 7:25 ` [PATCH V4 09/18] amdkfd: find kfd_process by filep->private_data in kfd_mmap Zhu Lingshan
2025-09-23 7:26 ` [PATCH V4 10/18] amdkfd: remove DIQ support Zhu Lingshan
2025-09-24 21:41 ` Kuehling, Felix
2025-09-23 7:26 ` [PATCH V4 11/18] amdkfd: process pointer of a HIQ should be NULL Zhu Lingshan
2025-09-24 21:43 ` Kuehling, Felix
2025-09-23 7:26 ` [PATCH V4 12/18] amdkfd: remove test_kq Zhu Lingshan
2025-09-23 7:26 ` [PATCH V4 13/18] amdkfd: introduce new helper kfd_lookup_process_by_id Zhu Lingshan
2025-09-23 7:26 ` [PATCH V4 14/18] amdkfd: record kfd process id into kfd process_info Zhu Lingshan
2025-09-24 21:45 ` Kuehling, Felix [this message]
2025-09-26 2:51 ` Zhu, Lingshan
2025-09-23 7:26 ` [PATCH V4 15/18] amdkfd: record kfd process id in amdkfd_fence Zhu Lingshan
2025-09-23 7:26 ` [PATCH V4 16/18] amdkfd: fence handler evict and restore a kfd process by its id Zhu Lingshan
2025-09-23 7:26 ` [PATCH V4 17/18] amdkfd: set_debug_trap ioctl only works on a primary kfd_process target Zhu Lingshan
2025-09-24 21:50 ` Kuehling, Felix
2025-09-26 2:49 ` Zhu, Lingshan
2025-10-01 5:42 ` Kuehling, Felix
2025-09-23 7:26 ` [PATCH V4 18/18] amdkfd: introduce new ioctl AMDKFD_IOC_CREATE_PROCESS Zhu Lingshan
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=c0997b76-e9ab-4c03-a2ec-16f39de2ee59@amd.com \
--to=felix.kuehling@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=lingshan.zhu@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.