AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
	Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
	dri-devel@lists.freedesktop.org, tursulin@igalia.com,
	simona.vetter@ffwll.ch, robdclark@gmail.com,
	alexander.deucher@amd.com, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 3/6] drm/amdgpu: delay the use of amdgpu_vm_set_task_info
Date: Tue, 24 Sep 2024 10:23:59 +0200	[thread overview]
Message-ID: <ca494935-cf38-4bad-ab5c-2afdc9ce3d33@amd.com> (raw)
In-Reply-To: <121a41fe-6637-41ca-a21e-7bd01dc0f0bf@igalia.com>

Am 23.09.24 um 12:25 schrieb Tvrtko Ursulin:
>
> On 20/09/2024 10:06, Pierre-Eric Pelloux-Prayer wrote:
>> At this point the vm is locked so we safely modify it without risk of
>> concurrent access.
>
> To which particular lock this is referring to and does this imply 
> previous placement was unsafe?

We use the root PDs dma_resv object as VM lock to protect most field 
inside the VM structure, only a few are protected by an additional spinlock.

And yes, previously it was possible that you got a mangled process/task 
name because no lock was protecting the task_info structure.

Regards,
Christian.

>
> Regards,
>
> Tvrtko
>
>> Signed-off-by: Pierre-Eric Pelloux-Prayer 
>> <pierre-eric.pelloux-prayer@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> index 1e475eb01417..891128ecee6d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>> @@ -309,9 +309,6 @@ static int amdgpu_cs_pass1(struct 
>> amdgpu_cs_parser *p,
>>           p->gang_leader->uf_addr = uf_offset;
>>       kvfree(chunk_array);
>>   -    /* Use this opportunity to fill in task info for the vm */
>> -    amdgpu_vm_set_task_info(vm);
>> -
>>       return 0;
>>     free_all_kdata:
>> @@ -1180,6 +1177,9 @@ static int amdgpu_cs_vm_handling(struct 
>> amdgpu_cs_parser *p)
>>           job->vm_pd_addr = amdgpu_gmc_pd_addr(vm->root.bo);
>>       }
>>   +    /* Use this opportunity to fill in task info for the vm */
>> +    amdgpu_vm_set_task_info(vm);
>> +
>>       if (adev->debug_vm) {
>>           /* Invalidate all BOs to test for userspace bugs */
>>           amdgpu_bo_list_for_each_entry(e, p->bo_list) {


  reply	other threads:[~2024-09-24  8:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20  9:06 [PATCH v3 0/6] DRM_SET_NAME ioctl Pierre-Eric Pelloux-Prayer
2024-09-20  9:06 ` [PATCH v3 1/6] drm: add " Pierre-Eric Pelloux-Prayer
2024-09-23 10:06   ` Tvrtko Ursulin
2024-09-24  8:22     ` Pierre-Eric Pelloux-Prayer
2024-09-24  8:38       ` Tvrtko Ursulin
2024-09-23 10:28   ` Dmitry Osipenko
2024-09-23 11:03     ` Dmitry Osipenko
2024-09-23 16:29     ` Pierre-Eric Pelloux-Prayer
2024-09-23 18:09       ` Dmitry Osipenko
2024-09-23 18:18         ` Dmitry Osipenko
2024-09-24 23:28           ` Dmitry Osipenko
2024-09-20  9:06 ` [PATCH v3 2/6] drm: use drm_file name in fdinfo Pierre-Eric Pelloux-Prayer
2024-09-20  9:06 ` [PATCH v3 3/6] drm/amdgpu: delay the use of amdgpu_vm_set_task_info Pierre-Eric Pelloux-Prayer
2024-09-23 10:25   ` Tvrtko Ursulin
2024-09-24  8:23     ` Christian König [this message]
2024-09-24  8:43       ` Tvrtko Ursulin
2024-09-24 10:01         ` Pierre-Eric Pelloux-Prayer
2024-09-20  9:06 ` [PATCH v3 4/6] drm/amdgpu: alloc and init vm::task_info from first submit Pierre-Eric Pelloux-Prayer
2024-09-23 10:58   ` Tvrtko Ursulin
2024-09-24  7:21     ` Pierre-Eric Pelloux-Prayer
2024-09-20  9:06 ` [PATCH v3 5/6] drm/amdgpu: make process_name a flexible array Pierre-Eric Pelloux-Prayer
2024-09-20  9:06 ` [PATCH v3 6/6] drm/amdgpu: use drm_file::name in task_info::process_desc Pierre-Eric Pelloux-Prayer
2024-09-20 12:08   ` Christian König

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=ca494935-cf38-4bad-ab5c-2afdc9ce3d33@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=robdclark@gmail.com \
    --cc=simona.vetter@ffwll.ch \
    --cc=tursulin@igalia.com \
    --cc=tvrtko.ursulin@igalia.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