From: zhoucm1 <david1.zhou-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
"Zhang,
Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/6] drm/amdgpu: add dedicated vmid field in vm struct
Date: Wed, 26 Apr 2017 17:46:56 +0800 [thread overview]
Message-ID: <59006C90.60806@amd.com> (raw)
In-Reply-To: <f41de8f1-11d9-a727-c34f-d218b08f9047-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
On 2017年04月26日 17:45, Christian König wrote:
> Am 26.04.2017 um 11:14 schrieb zhoucm1:
>>
>>
>> On 2017年04月26日 17:10, Christian König wrote:
>>> Am 26.04.2017 um 11:05 schrieb zhoucm1:
>>>>
>>>>
>>>> On 2017年04月26日 16:49, Christian König wrote:
>>>>> Am 26.04.2017 um 09:09 schrieb Zhang, Jerry (Junwei):
>>>>>> On 04/24/2017 01:57 PM, Chunming Zhou wrote:
>>>>>>> Change-Id: Id728e20366c8a1ae90d4e901dc80e136e2a613bb
>>>>>>> Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
>>>>>>> ---
>>>>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 17 ++++++++++++++++-
>>>>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 ++
>>>>>>> 2 files changed, 18 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>>>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>>>>>> index eb429c5..acf9102 100644
>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>>>>>> @@ -2144,10 +2144,12 @@ int amdgpu_vm_init(struct amdgpu_device
>>>>>>> *adev, struct amdgpu_vm *vm,
>>>>>>> unsigned ring_instance;
>>>>>>> struct amdgpu_ring *ring;
>>>>>>> struct amd_sched_rq *rq;
>>>>>>> - int r;
>>>>>>> + int r, i;
>>>>>>>
>>>>>>> vm->va = RB_ROOT;
>>>>>>> vm->client_id =
>>>>>>> atomic64_inc_return(&adev->vm_manager.client_counter);
>>>>>>> + for (i = 0; i < AMDGPU_MAX_VMHUBS; i++)
>>>>>>> + vm->dedicated_vmid[i] = NULL;
>>>>>>
>>>>>> Maybe it's better to give it a consistent name as resv_vmid, or
>>>>>> anything like that.
>>>>>
>>>>> Yes, agree.
>>>> I think the reserved vmid is dedicated to this vm, I don't know
>>>> where this name doesn't make sense.
>>>>
>>>>> And if I'm not completely mistaken we still should only apply that
>>>>> to the GFX hub on Vega10.
>>>> David Mao required mmhub as well. IIRC, we don't have necessary to
>>>> argue more on this.
>>>
>>> I think we still have. There is no technical reason why we should
>>> use the reserved/dedicated VM for other engines than the one
>>> involved in the SQ trace.
>> How about removing SQ trace reason? is it ok just that one process
>> wants to do experiment for other purpose? :)
>
> In this case I would clearly NAK the whole approach.
Which makes me very difficult to talk between you and David Mao.
Regards,
David Zhou
>
> Regards,
> Christian.
>
>>
>> Regards,
>> David Zhou
>>>
>>> So I would say we should limit this to GFX and Compute jobs and only
>>> allocate the dedicated VMID for those.
>>>
>>> Regards,
>>> Christian.
>>>
>>>>
>>>> Regards,
>>>> David Zhou
>>>>>
>>>>> Christian.
>>>>>
>>>>>>
>>>>>> Jerry
>>>>>>> spin_lock_init(&vm->status_lock);
>>>>>>> INIT_LIST_HEAD(&vm->invalidated);
>>>>>>> INIT_LIST_HEAD(&vm->cleared);
>>>>>>> @@ -2250,6 +2252,7 @@ void amdgpu_vm_fini(struct amdgpu_device
>>>>>>> *adev, struct amdgpu_vm *vm)
>>>>>>> {
>>>>>>> struct amdgpu_bo_va_mapping *mapping, *tmp;
>>>>>>> bool prt_fini_needed = !!adev->gart.gart_funcs->set_prt;
>>>>>>> + int i;
>>>>>>>
>>>>>>> if (vm->is_kfd_vm) {
>>>>>>> struct amdgpu_vm_id_manager *id_mgr =
>>>>>>> @@ -2292,6 +2295,18 @@ void amdgpu_vm_fini(struct amdgpu_device
>>>>>>> *adev, struct amdgpu_vm *vm)
>>>>>>>
>>>>>>> amdgpu_vm_free_levels(&vm->root);
>>>>>>> fence_put(vm->last_dir_update);
>>>>>>> + for (i = 0; i < AMDGPU_MAX_VMHUBS; i++) {
>>>>>>> + struct amdgpu_vm_id_manager *id_mgr =
>>>>>>> + &adev->vm_manager.id_mgr[i];
>>>>>>> +
>>>>>>> + mutex_lock(&id_mgr->lock);
>>>>>>> + if (vm->dedicated_vmid[i]) {
>>>>>>> + list_add(&vm->dedicated_vmid[i]->list,
>>>>>>> + &id_mgr->ids_lru);
>>>>>>> + vm->dedicated_vmid[i] = NULL;
>>>>>>> + }
>>>>>>> + mutex_unlock(&id_mgr->lock);
>>>>>>> + }
>>>>>>> }
>>>>>>>
>>>>>>> /**
>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
>>>>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
>>>>>>> index 62dbace..23981ee 100644
>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
>>>>>>> @@ -122,6 +122,8 @@ struct amdgpu_vm {
>>>>>>>
>>>>>>> /* client id */
>>>>>>> u64 client_id;
>>>>>>> + /* dedicated vmid */
>>>>>>> + struct amdgpu_vm_id *dedicated_vmid[AMDGPU_MAX_VMHUBS];
>>>>>>> /* each VM will map on CSA */
>>>>>>> struct amdgpu_bo_va *csa_bo_va;
>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> amd-gfx mailing list
>>>>>> amd-gfx@lists.freedesktop.org
>>>>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> amd-gfx mailing list
>>>> amd-gfx@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>>>
>>>
>>
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-04-26 9:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 5:57 [PATCH 0/6] *** Dedicated vmid per process v2 *** Chunming Zhou
[not found] ` <1493013460-13344-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-24 5:57 ` [PATCH 1/6] drm/amdgpu: add vm ioctl Chunming Zhou
[not found] ` <1493013460-13344-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 7:09 ` Zhang, Jerry (Junwei)
[not found] ` <590047A5.1070807-5C7GfCeVMHo@public.gmane.org>
2017-04-26 8:47 ` Christian König
2017-04-24 5:57 ` [PATCH 2/6] drm/amdgpu: add dedicated vmid field in vm struct Chunming Zhou
[not found] ` <1493013460-13344-3-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 7:09 ` Zhang, Jerry (Junwei)
[not found] ` <590047B3.7050109-5C7GfCeVMHo@public.gmane.org>
2017-04-26 8:49 ` Christian König
[not found] ` <291734a9-5306-f3e3-219c-c53cbf433358-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 9:05 ` zhoucm1
[not found] ` <590062C5.6020402-5C7GfCeVMHo@public.gmane.org>
2017-04-26 9:10 ` Christian König
[not found] ` <05c4fcec-9dae-24ac-4a5d-26e0fd5bc148-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 9:14 ` zhoucm1
[not found] ` <59006508.7080907-5C7GfCeVMHo@public.gmane.org>
2017-04-26 9:45 ` Christian König
[not found] ` <f41de8f1-11d9-a727-c34f-d218b08f9047-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 9:46 ` zhoucm1 [this message]
2017-04-24 5:57 ` [PATCH 3/6] drm/amdgpu: reserve vmid by vm ioctl Chunming Zhou
[not found] ` <1493013460-13344-4-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 7:09 ` Zhang, Jerry (Junwei)
[not found] ` <590047C6.50005-5C7GfCeVMHo@public.gmane.org>
2017-04-26 8:51 ` Christian König
[not found] ` <238b3d86-743a-4ca9-c008-92ae4e1ec79c-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26 9:04 ` Zhang, Jerry (Junwei)
[not found] ` <5900629A.20701-5C7GfCeVMHo@public.gmane.org>
2017-04-26 9:08 ` Christian König
2017-04-24 5:57 ` [PATCH 4/6] drm/amdgpu: add limitation for dedicated vm number v2 Chunming Zhou
[not found] ` <1493013460-13344-5-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 7:10 ` Zhang, Jerry (Junwei)
[not found] ` <590047D0.7080901-5C7GfCeVMHo@public.gmane.org>
2017-04-26 8:53 ` Christian König
2017-04-24 5:57 ` [PATCH 5/6] drm/amdgpu: implement grab dedicated vmid V2 Chunming Zhou
2017-04-24 5:57 ` [PATCH 6/6] drm/amdgpu: bump module verion for reserved vmid Chunming Zhou
2017-04-25 9:07 ` [PATCH 0/6] *** Dedicated vmid per process v2 *** zhoucm1
[not found] ` <58FF11E7.6040607-5C7GfCeVMHo@public.gmane.org>
2017-04-25 10:02 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2017-04-26 11:10 [PATCH 0/6 v3] *** Dedicated vmid per process v3 *** Chunming Zhou
[not found] ` <1493205039-3721-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-26 11:10 ` [PATCH 2/6] drm/amdgpu: add dedicated vmid field in vm struct Chunming Zhou
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=59006C90.60806@amd.com \
--to=david1.zhou-5c7gfcevmho@public.gmane.org \
--cc=Jerry.Zhang-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org \
/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.