All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: Alex Sierra <alex.sierra@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/amdkfd: add invalid pages debug at vram migration
Date: Mon, 17 May 2021 10:38:18 -0400	[thread overview]
Message-ID: <8d8b5ab4-df54-a190-0845-1fdacfc2046e@amd.com> (raw)
In-Reply-To: <20210512173429.957-3-alex.sierra@amd.com>


Am 2021-05-12 um 1:34 p.m. schrieb Alex Sierra:

> This is for debug purposes only.
> It conditionally generates partial migrations to test mixed
> CPU/GPU memory domain pages in a prange easily.
>
> Signed-off-by: Alex Sierra <alex.sierra@amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> index e1cc844b2f4e..4c6e340393fb 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> @@ -403,6 +403,20 @@ svm_migrate_copy_to_vram(struct amdgpu_device *adev, struct svm_range *prange,
>  		}
>  	}
>  
> +#ifdef DEBUG_FORCE_MIXED_DOMAINS
> +	for (i = 0, j = 0; i < npages; i += 4, j++) {
> +		if (j & 1)
> +			continue;
> +		svm_migrate_put_vram_page(adev, dst[i]);
> +		migrate->dst[i] = 0;
> +		svm_migrate_put_vram_page(adev, dst[i + 1]);
> +		migrate->dst[i + 1] = 0;
> +		svm_migrate_put_vram_page(adev, dst[i + 2]);
> +		migrate->dst[i + 2] = 0;
> +		svm_migrate_put_vram_page(adev, dst[i + 3]);
> +		migrate->dst[i + 3] = 0;
> +	}
> +#endif

You're doing this at the end of svm_migrate_copy_to_vram. If you did it
in the beginning, you could also check that svm_migrate_copy_to_vram
itself is behaving correctly for partial migrations.

Regards,
  Felix


>  out:
>  	return r;
>  }
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-05-17 14:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 17:34 [PATCH 1/3] drm/amdkfd: classify and map mixed svm range pages in GPU Alex Sierra
2021-05-12 17:34 ` [PATCH 2/3] drm/amdkfd: skip invalid pages during migrations Alex Sierra
2021-05-17 13:54   ` Felix Kuehling
2021-05-12 17:34 ` [PATCH 3/3] drm/amdkfd: add invalid pages debug at vram migration Alex Sierra
2021-05-17 14:38   ` Felix Kuehling [this message]
2021-05-17 13:44 ` [PATCH 1/3] drm/amdkfd: classify and map mixed svm range pages in GPU Felix Kuehling
2021-05-17 14:40   ` Felix Kuehling

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=8d8b5ab4-df54-a190-0845-1fdacfc2046e@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=alex.sierra@amd.com \
    --cc=amd-gfx@lists.freedesktop.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.