From: "Christian König" <christian.koenig@amd.com>
To: "Khatri, Sunil" <sukhatri@amd.com>,
tursulin@ursulin.net, Alexander.Deucher@amd.com,
Prike.Liang@amd.com, Yogesh.Mohanmarimuthu@amd.com,
SRINIVASAN.SHANMUGAM@amd.com, Sunil.Khatri@amd.com,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/11] drm/amdgpu: restructure VM state machine
Date: Thu, 12 Mar 2026 13:49:26 +0100 [thread overview]
Message-ID: <72d9f9df-e762-4d9e-a351-91fa2c457600@amd.com> (raw)
In-Reply-To: <20cd6ab0-97de-41c3-8bb0-56f6ec47ae19@amd.com>
On 3/11/26 09:47, Khatri, Sunil wrote:
>
> On 11-03-2026 12:43 am, Christian König wrote:
>> Instead of comming up with more sophisticated names for states a VM BO
>> can be in group them by the type of BO first and then by the state.
>>
>> So we end with BO type kernel, shared_resv and individual_resv and then
>> states evicted, moved and idle.
>>
>> Not much functional change, except that evicted_user is moved back
>> together with the other BOs again which makes the handling in
>> amdgpu_vm_validate() a bit more complex. Also fixes a problem with user
>> queues and amdgpu_vm_ready().
> Some typos in commit message.
Can you point them out? I only the the extra "m" in the first sentence of hand.
>> @@ -349,46 +366,22 @@ struct amdgpu_vm {
>> spinlock_t stats_lock;
>> struct amdgpu_mem_stats stats[__AMDGPU_PL_NUM];
>>
>> - /*
>> - * The following lists contain amdgpu_vm_bo_base objects for either
>> - * PDs, PTs or per VM BOs. The state transits are:
>> - *
>> - * evicted -> relocated (PDs, PTs) or moved (per VM BOs) -> idle
>> - *
>> - * Lists are protected by the root PD dma_resv lock.
>> - */
>> -
>> - /* Per-VM and PT BOs who needs a validation */
>> - struct list_head evicted;
>> -
>> - /* PT BOs which relocated and their parent need an update */
>> - struct list_head relocated;
>> + /* kernel PD/Pts, resv is shared with the root PD */
>> + struct amdgpu_vm_bo_status kernel;
>>
>> - /* per VM BOs moved, but not yet updated in the PT */
>> - struct list_head moved;
>> -
>> - /* All BOs of this VM not currently in the state machine */
>> - struct list_head idle;
>> + /* userspace BOs where the resv object is shared with the root PD */
>> + struct amdgpu_vm_bo_status shared_resv;
>>
>> /*
>> * The following lists contain amdgpu_vm_bo_base objects for BOs which
>> - * have their own dma_resv object and not depend on the root PD. Their
>> - * state transits are:
>> - *
>> - * evicted_user or invalidated -> done
>> + * have their own dma_resv object and not depend on the root PD.
>
> We might want to move the explanation before the individual_resv list for clarity. Grouping idea seems great and seems to simply the things to good extent. But just for better explanation and more clarity for others and documentation purposes if we want can add more details:
>
> kernel: BO's belonging to PD/PT and other BOs which are internal to the kernel.
>
> shared_resv BO's belonging to per process but still allocated by the driver/kernel for each process, for name can we says per_process
>
> individual_resv : BO's whose memory is allocated by user for completely user managed buffers per process (User ptrs), alternate name : user_private or something.
Mhm, that description is actually not correct. Those are not necessarily userptrs but can also be normal BOs shared with other processes or devices.
I will try to come up with some better comments.
>
> Apart from the nitpicks, the change looks great and simplify things.
>
> Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Thanks,
Christian.
>
> Regards Sunil Khatri
>
>> *
>> * Lists are protected by the invalidated_lock.
>> */
>> spinlock_t invalidated_lock;
>>
>> - /* BOs for user mode queues that need a validation */
>> - struct list_head evicted_user;
>> -
>> - /* regular invalidated BOs, but not yet updated in the PT */
>> - struct list_head invalidated;
>> -
>> - /* BOs which are invalidated, has been updated in the PTs */
>> - struct list_head done;
>> + /* Userspace BOs with individual resv object */
>> + struct amdgpu_vm_bo_status individual_resv;
>>
>> /*
>> * This list contains amdgpu_bo_va_mapping objects which have been freed
next prev parent reply other threads:[~2026-03-12 12:49 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 19:13 [PATCH 01/11] drm/amdgpu: revert to old status lock handling v4 Christian König
2026-03-10 19:13 ` [PATCH 02/11] drm/amdgpu: restructure VM state machine Christian König
2026-03-11 8:47 ` Khatri, Sunil
2026-03-12 12:49 ` Christian König [this message]
2026-03-12 10:07 ` Liang, Prike
2026-03-12 14:32 ` Tvrtko Ursulin
2026-03-16 13:44 ` Christian König
2026-03-16 14:26 ` Tvrtko Ursulin
2026-03-10 19:13 ` [PATCH 03/11] drm/amdgpu: fix amdgpu_userq_evict Christian König
2026-03-11 8:51 ` Khatri, Sunil
2026-03-13 7:25 ` Liang, Prike
2026-03-10 19:13 ` [PATCH 04/11] drm/amdgpu: completely rework eviction fence handling Christian König
2026-03-11 12:27 ` Khatri, Sunil
2026-03-13 8:00 ` Khatri, Sunil
2026-03-17 9:41 ` Christian König
2026-03-13 8:28 ` Liang, Prike
2026-03-17 9:57 ` Christian König
2026-03-17 11:21 ` Liang, Prike
2026-03-17 11:23 ` Christian König
2026-03-17 11:54 ` Liang, Prike
2026-03-10 19:13 ` [PATCH 05/11] drm/amdgpu: fix eviction fence and userq manager shutdown Christian König
2026-03-11 12:26 ` Khatri, Sunil
2026-03-13 9:35 ` Khatri, Sunil
2026-03-10 19:13 ` [PATCH 06/11] drm/amdgpu: fix adding eviction fence Christian König
2026-03-11 12:26 ` Khatri, Sunil
2026-03-10 19:13 ` [PATCH 07/11] drm/amdgpu: rework amdgpu_userq_wait_ioctl v3 Christian König
2026-03-12 16:34 ` Tvrtko Ursulin
2026-03-16 14:19 ` Christian König
2026-03-16 14:44 ` Tvrtko Ursulin
2026-03-17 7:05 ` Khatri, Sunil
2026-03-10 19:13 ` [PATCH 08/11] drm/amdgpu: make amdgpu_user_wait_ioctl more resilent v2 Christian König
2026-03-17 7:15 ` Khatri, Sunil
2026-03-10 19:13 ` [PATCH 09/11] drm/amdgpu: annotate eviction fence signaling path Christian König
2026-03-17 7:35 ` Khatri, Sunil
2026-03-10 19:13 ` [PATCH 10/11] drm/amdgpu: fix some more bug in amdgpu_gem_va_ioctl Christian König
2026-03-17 8:44 ` Khatri, Sunil
2026-03-17 11:08 ` Christian König
2026-03-10 19:13 ` [PATCH 11/11] drm/amdgpu: WIP sync amdgpu_ttm_fill_mem only to kernel fences Christian König
2026-03-17 8:59 ` Khatri, Sunil
2026-03-17 10:52 ` Christian König
2026-03-11 7:43 ` [PATCH 01/11] drm/amdgpu: revert to old status lock handling v4 Khatri, Sunil
2026-03-12 7:13 ` Liang, Prike
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=72d9f9df-e762-4d9e-a351-91fa2c457600@amd.com \
--to=christian.koenig@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Prike.Liang@amd.com \
--cc=SRINIVASAN.SHANMUGAM@amd.com \
--cc=Sunil.Khatri@amd.com \
--cc=Yogesh.Mohanmarimuthu@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=sukhatri@amd.com \
--cc=tursulin@ursulin.net \
/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