AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Zhou,
	David(ChunMing)" <David1.Zhou-5C7GfCeVMHo@public.gmane.org>,
	"Christian König"
	<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 6/7] drm/amdgpu: stop joining VM PTE updates
Date: Thu, 18 May 2017 13:35:49 +0800	[thread overview]
Message-ID: <591D32B5.3000807@amd.com> (raw)
In-Reply-To: <MWHPR1201MB02064FC493616E242D75A2C6B4E70-3iK1xFAIwjrUF/YbdlDdgWrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>

On 05/17/2017 06:08 PM, Zhou, David(ChunMing) wrote:
>
> Patch#2: Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
> Patch#3: RB should be from Hawking, so Acked-by: Chunming Zhou <david1.zhou@amd.com>
> Patch#5 #6, are Reviewed-by: Chunming Zhou <david1.zhou@amd.com>

Feel free to add my RB about Patch #2 ~ #5

Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>

Jerry

>
> For patch#7, further transfer +1 page table, I need a bit time of tomorrow.
>
> Regards,
> David Zhou
>
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Christian K?nig
> Sent: Wednesday, May 17, 2017 5:23 PM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH 6/7] drm/amdgpu: stop joining VM PTE updates
>
> From: Christian König <christian.koenig@amd.com>
>
> This isn't beneficial any more since VRAM allocations are now split so that they fits into a single page table.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 61 ++++------------------------------
>   1 file changed, 7 insertions(+), 54 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 6a926f4..860a669 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1191,41 +1191,12 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
>   	struct amdgpu_device *adev = params->adev;
>   	const uint64_t mask = AMDGPU_VM_PTE_COUNT(adev) - 1;
>
> -	uint64_t cur_pe_start, cur_nptes, cur_dst;
> -	uint64_t addr; /* next GPU address to be updated */
> +	uint64_t addr, pe_start;
>   	struct amdgpu_bo *pt;
> -	unsigned nptes; /* next number of ptes to be updated */
> -	uint64_t next_pe_start;
> -
> -	/* initialize the variables */
> -	addr = start;
> -	pt = amdgpu_vm_get_pt(params, addr);
> -	if (!pt) {
> -		pr_err("PT not found, aborting update_ptes\n");
> -		return -EINVAL;
> -	}
> -
> -	if (params->shadow) {
> -		if (!pt->shadow)
> -			return 0;
> -		pt = pt->shadow;
> -	}
> -	if ((addr & ~mask) == (end & ~mask))
> -		nptes = end - addr;
> -	else
> -		nptes = AMDGPU_VM_PTE_COUNT(adev) - (addr & mask);
> -
> -	cur_pe_start = amdgpu_bo_gpu_offset(pt);
> -	cur_pe_start += (addr & mask) * 8;
> -	cur_nptes = nptes;
> -	cur_dst = dst;
> -
> -	/* for next ptb*/
> -	addr += nptes;
> -	dst += nptes * AMDGPU_GPU_PAGE_SIZE;
> +	unsigned nptes;
>
>   	/* walk over the address space and update the page tables */
> -	while (addr < end) {
> +	for (addr = start; addr < end; addr += nptes) {
>   		pt = amdgpu_vm_get_pt(params, addr);
>   		if (!pt) {
>   			pr_err("PT not found, aborting update_ptes\n"); @@ -1243,33 +1214,15 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
>   		else
>   			nptes = AMDGPU_VM_PTE_COUNT(adev) - (addr & mask);
>
> -		next_pe_start = amdgpu_bo_gpu_offset(pt);
> -		next_pe_start += (addr & mask) * 8;
> -
> -		if ((cur_pe_start + 8 * cur_nptes) == next_pe_start &&
> -		    ((cur_nptes + nptes) <= AMDGPU_VM_MAX_UPDATE_SIZE)) {
> -			/* The next ptb is consecutive to current ptb.
> -			 * Don't call the update function now.
> -			 * Will update two ptbs together in future.
> -			*/
> -			cur_nptes += nptes;
> -		} else {
> -			params->func(params, cur_pe_start, cur_dst, cur_nptes,
> -				     AMDGPU_GPU_PAGE_SIZE, flags);
> +		pe_start = amdgpu_bo_gpu_offset(pt);
> +		pe_start += (addr & mask) * 8;
>
> -			cur_pe_start = next_pe_start;
> -			cur_nptes = nptes;
> -			cur_dst = dst;
> -		}
> +		params->func(params, pe_start, dst, nptes,
> +			     AMDGPU_GPU_PAGE_SIZE, flags);
>
> -		/* for next ptb*/
> -		addr += nptes;
>   		dst += nptes * AMDGPU_GPU_PAGE_SIZE;
>   	}
>
> -	params->func(params, cur_pe_start, cur_dst, cur_nptes,
> -		     AMDGPU_GPU_PAGE_SIZE, flags);
> -
>   	return 0;
>   }
>
> --
> 2.7.4
>
> _______________________________________________
> 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

  parent reply	other threads:[~2017-05-18  5:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17  9:22 [PATCH 1/7] drm/amdgpu: cleanup adjust_mc_addr handling v2 Christian König
     [not found] ` <1495012972-20698-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-17  9:22   ` [PATCH 2/7] drm/amdgpu: add some extra VM error handling Christian König
2017-05-17  9:22   ` [PATCH 3/7] drm/amdgpu: fix another fundamental VM bug Christian König
2017-05-17  9:22   ` [PATCH 4/7] drm/amdgpu: Return EINVAL if no PT BO Christian König
2017-05-17  9:22   ` [PATCH 5/7] drm/amdgpu: cache the complete pde Christian König
2017-05-17  9:22   ` [PATCH 6/7] drm/amdgpu: stop joining VM PTE updates Christian König
     [not found]     ` <1495012972-20698-6-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-17 10:08       ` Zhou, David(ChunMing)
     [not found]         ` <MWHPR1201MB02064FC493616E242D75A2C6B4E70-3iK1xFAIwjrUF/YbdlDdgWrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-05-18  5:35           ` Zhang, Jerry (Junwei) [this message]
2017-05-17  9:22   ` [PATCH 7/7] drm/amdgpu: enable huge page handling in the VM Christian König
     [not found]     ` <1495012972-20698-7-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-18  5:30       ` zhoucm1
     [not found]         ` <591D3164.7070105-5C7GfCeVMHo@public.gmane.org>
2017-05-24  9:15           ` Christian König
     [not found]             ` <5efe2316-b0bb-799b-345e-120c040237ae-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-24  9:28               ` zhoucm1
2017-05-18  5:33   ` [PATCH 1/7] drm/amdgpu: cleanup adjust_mc_addr handling v2 Zhang, Jerry (Junwei)
     [not found]     ` <591D323A.5000304-5C7GfCeVMHo@public.gmane.org>
2017-05-24  9:18       ` Christian König
     [not found]         ` <b9c0c5b3-a42c-b2e8-0b84-718807d5e7cf-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-05-25  2:10           ` Zhang, Jerry (Junwei)

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=591D32B5.3000807@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=David1.Zhou-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox