From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: Andrey Grodzovsky
<andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: zhoucm1-5C7GfCeVMHo@public.gmane.org,
christian.koenig-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH v3 2/2] drm/admgpu: Present amdgpu_task_info in VM_FAULTS.
Date: Mon, 9 Jul 2018 13:13:18 +0800 [thread overview]
Message-ID: <5B42EEEE.30305@amd.com> (raw)
In-Reply-To: <1530818820-28631-2-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
On 07/06/2018 03:27 AM, Andrey Grodzovsky wrote:
> Extract and present the reposnsible process and thread when
> VM_FAULT happens.
>
> v2: Use getter and setter functions.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++++
> drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 10 +++++++---
> drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 9 +++++++--
> 3 files changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 7a625f3..609c8f5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -187,6 +187,10 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
> if (p->uf_entry.robj)
> p->job->uf_addr = uf_offset;
> kfree(chunk_array);
> +
> + /* Use this opportunity to fill in task info for the vm */
> + amdgpu_vm_set_task_info(vm);
> +
Shall we set the task info when vm init?
> return 0;
>
> free_all_kdata:
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> index 08753e7..75f3ffb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> @@ -46,7 +46,6 @@
>
> #include "ivsrcid/ivsrcid_vislands30.h"
>
> -
> static void gmc_v8_0_set_gmc_funcs(struct amdgpu_device *adev);
> static void gmc_v8_0_set_irq_funcs(struct amdgpu_device *adev);
> static int gmc_v8_0_wait_for_idle(void *handle);
> @@ -1449,8 +1448,13 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,
> gmc_v8_0_set_fault_enable_default(adev, false);
>
> if (printk_ratelimit()) {
> - dev_err(adev->dev, "GPU fault detected: %d 0x%08x\n",
> - entry->src_id, entry->src_data[0]);
> + struct amdgpu_task_info task_info = { 0 };
> +
> + amdgpu_vm_get_task_info(adev, entry->pasid, &task_info);
Shall we find vm and get the vm->task_info directly instead of filling local variable task_info?
(current style is also OK for me, just for more info)
And we may also check the return value for "NULL" case, otherwise it may cause access errorin dev_err(),
if failed to find vm (although, it's most unlikely to happen).
Jerry
> +
> + dev_err(adev->dev, "GPU fault detected: %d 0x%08x for process %s pid %d thread %s pid %d\n",
> + entry->src_id, entry->src_data[0], task_info.process_name,
> + task_info.tgid, task_info.task_name, task_info.pid);
> dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
> addr);
> dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index 691a659..9df94b4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -259,11 +259,16 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
> }
>
> if (printk_ratelimit()) {
> + struct amdgpu_task_info task_info = { 0 };
> +
> + amdgpu_vm_get_task_info(adev, entry->pasid, &task_info);
> +
> dev_err(adev->dev,
> - "[%s] VMC page fault (src_id:%u ring:%u vmid:%u pasid:%u)\n",
> + "[%s] VMC page fault (src_id:%u ring:%u vmid:%u pasid:%u, for process %s pid %d thread %s pid %d\n)\n",
> entry->vmid_src ? "mmhub" : "gfxhub",
> entry->src_id, entry->ring_id, entry->vmid,
> - entry->pasid);
> + entry->pasid, task_info.process_name, task_info.tgid,
> + task_info.task_name, task_info.pid);
> dev_err(adev->dev, " at page 0x%016llx from %d\n",
> addr, entry->client_id);
> if (!amdgpu_sriov_vf(adev))
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-07-09 5:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 19:26 [PATCH v3 1/2] drm/amdgpu: Add support for logging process info in amdgpu_vm Andrey Grodzovsky
[not found] ` <1530818820-28631-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2018-07-05 19:27 ` [PATCH v3 2/2] drm/admgpu: Present amdgpu_task_info in VM_FAULTS Andrey Grodzovsky
[not found] ` <1530818820-28631-2-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2018-07-06 3:09 ` 答复: " Qu, Jim
2018-07-09 5:13 ` Zhang, Jerry (Junwei) [this message]
[not found] ` <5B42EEEE.30305-5C7GfCeVMHo@public.gmane.org>
2018-07-09 7:04 ` Christian König
[not found] ` <d87f8526-e528-2c00-bfa7-e433c490c033-5C7GfCeVMHo@public.gmane.org>
2018-07-09 7:48 ` Zhang, Jerry (Junwei)
[not found] ` <5B43133A.2020300-5C7GfCeVMHo@public.gmane.org>
2018-07-09 8:55 ` Christian König
[not found] ` <6a051779-2711-adba-aa88-e10d3ff20b6f-5C7GfCeVMHo@public.gmane.org>
2018-07-09 10:14 ` Zhang, Jerry (Junwei)
[not found] ` <5B433598.8000308-5C7GfCeVMHo@public.gmane.org>
2018-07-09 11:29 ` Christian König
[not found] ` <3f49bd26-26e6-459e-ac76-284fae1efdbb-5C7GfCeVMHo@public.gmane.org>
2018-07-10 3:14 ` 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=5B42EEEE.30305@amd.com \
--to=jerry.zhang-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org \
--cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
--cc=zhoucm1-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.