All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	"Zhou,
	David(ChunMing)" <David1.Zhou-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: skip huge page for PRT mapping
Date: Tue, 5 Jun 2018 14:50:20 +0800	[thread overview]
Message-ID: <5B1632AC.2060906@amd.com> (raw)
In-Reply-To: <b819e5ef-d08e-f2ba-ff28-a601dcd7eee7-5C7GfCeVMHo@public.gmane.org>

On 06/05/2018 02:20 PM, Christian König wrote:
> Hi Jerry,
>
> Am 05.06.2018 um 03:50 schrieb Zhang, Jerry (Junwei):
>> [SNIP]
>>>
>>> Can you check if the problem also vanishes when you disable the following
>>> optimization in amdgpu_vm_update_ptes?
>>>>                 /* We don't need to update PTEs for huge pages */
>>>>                 if (entry->huge)
>>>>                         continue;
>>> Just comment this out for a test.
>>
>> Thanks to point it out.
>> That indeed works well too.
>>
>> The issue happened by missing to update PTE for reserved PRT range, if huge
>> page is introduced.
>>
>> Not sure if below change is expected to save the huge page for PRT support.
>> That updates the huge page and fills the correct PTE for PRT as well,
>> different from current fix patch.
>> {{{
>>                 /* We don't need to update PTEs for huge pages */
>> -               if (entry->huge)
>> +               if (entry->huge && !(flags & AMDGPU_PTE_PRT))
>>                         continue;
>>
>> }}}
>
> problem is that not only affects PRT, but all mappings.
>
> See the patch here if you currently can't receive mails from amd-gfx:
> https://patchwork.freedesktop.org/patch/227336/

Thanks for your info.
We may also need to add bo_va info, since the next replace(with clear mapping) 
will use that.
{{{
@@ -2172,6 +2172,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
                         before->last = saddr - 1;
                         before->offset = tmp->offset;
                         before->flags = tmp->flags;
+                       before->bo_va = tmp->bo_va;
                         list_add(&before->list, &tmp->bo_va->invalids);
                 }

@@ -2182,6 +2183,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
                         after->offset = tmp->offset;
                         after->offset += after->start - tmp->start;
                         after->flags = tmp->flags;
+                       after->bo_va = tmp->bo_va;
                         list_add(&after->list, &tmp->bo_va->invalids);

}}}

>
> Essentially I made a wrong assumption in the clear all code path. Please also
> note that I hadn't time to fully test this patch yet.

Yes, i will test it more.
And it could fix PRT issue as well.(without my patch)

Jerry

>
> Christian.
>
>>
>>
>> Jerry
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2018-06-05  6:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04  2:03 [PATCH] drm/amdgpu: skip huge page for PRT mapping Junwei Zhang
     [not found] ` <1528077815-32053-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-06-04  5:59   ` Zhou, David(ChunMing)
     [not found]     ` <BY1PR12MB0502AD59C8B89200345C8CDFB4670-PicGAnIBOobrCwm+z9iKNgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-06-04  6:43       ` Christian König
     [not found]         ` <648c1eb2-0729-7091-6df5-4795e720f25c-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-06-04  7:02           ` Zhang, Jerry (Junwei)
     [not found]             ` <5B14E41E.8030004-5C7GfCeVMHo@public.gmane.org>
2018-06-04  7:48               ` Christian König
     [not found]                 ` <b303b120-e096-6b3f-71f4-6464e1f2a763-5C7GfCeVMHo@public.gmane.org>
2018-06-04  8:19                   ` Zhang, Jerry (Junwei)
     [not found]                     ` <5B14F609.7020105-5C7GfCeVMHo@public.gmane.org>
2018-06-04  9:51                       ` Christian König
     [not found]                         ` <5d5211d6-440b-59a7-1eec-7e6f5d556ecf-5C7GfCeVMHo@public.gmane.org>
2018-06-04 11:01                           ` Christian König
     [not found]                             ` <f95b2d17-ca0e-fc5e-2927-873111a0251d-5C7GfCeVMHo@public.gmane.org>
2018-06-05  5:29                               ` Zhang, Jerry (Junwei)
2018-06-05  1:50                           ` Zhang, Jerry (Junwei)
     [not found]                             ` <5B15EC7E.6010203-5C7GfCeVMHo@public.gmane.org>
2018-06-05  6:20                               ` Christian König
     [not found]                                 ` <b819e5ef-d08e-f2ba-ff28-a601dcd7eee7-5C7GfCeVMHo@public.gmane.org>
2018-06-05  6:50                                   ` Zhang, Jerry (Junwei) [this message]

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=5B1632AC.2060906@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=David1.Zhou-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@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.