All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Zeng, Oak" <Oak.Zeng-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 03/11] drm/amdgpu: remove VM fault_credit handling
Date: Sat, 1 Dec 2018 14:59:28 +0100	[thread overview]
Message-ID: <858ea885-a6f2-ccb9-692c-086471fc8d2d@gmail.com> (raw)
In-Reply-To: <BN6PR12MB1651C10E3977C786DE29BB1980D30-/b2+HYfkarRSqX7PDniLCgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

This code was never used for retry faults, but only for non-retry faults 
and on HW generations older than GFX9.

Those handling where always protected by calls to "printk_ratelimit()" 
to prevent flooding the system log.

So the handling was never necessary to begin with,
Christian.

Am 30.11.18 um 22:07 schrieb Zeng, Oak:
> The credit was used to limit vm (retry) fault to be processed in each VM. If this is removed, it is possible that you get flooded interrupt storm.
>
> Even though you claimed from the commit message that, printk_ratelimit is a better solution, I didn't see you implement it in this patch. Are you planning a future patch?
>
> Thanks,
> Oak
>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Christian König
> Sent: Friday, November 30, 2018 7:36 AM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH 03/11] drm/amdgpu: remove VM fault_credit handling
>
> printk_ratelimit() is much better suited to limit the number of reported VM faults.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 37 -------------------------  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h  |  5 ----
>   drivers/gpu/drm/amd/amdgpu/cik_ih.c     | 18 +-----------
>   drivers/gpu/drm/amd/amdgpu/cz_ih.c      | 18 +-----------
>   drivers/gpu/drm/amd/amdgpu/iceland_ih.c | 18 +-----------
>   drivers/gpu/drm/amd/amdgpu/tonga_ih.c   | 18 +-----------
>   drivers/gpu/drm/amd/amdgpu/vega10_ih.c  |  7 ++---
>   7 files changed, 6 insertions(+), 115 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 2acb9838913e..a2f149da83f8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -3057,7 +3057,6 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
>   	}
>   
>   	INIT_KFIFO(vm->faults);
> -	vm->fault_credit = 16;
>   
>   	return 0;
>   
> @@ -3269,42 +3268,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
>   		amdgpu_vmid_free_reserved(adev, vm, i);  }
>   
> -/**
> - * amdgpu_vm_pasid_fault_credit - Check fault credit for given PASID
> - *
> - * @adev: amdgpu_device pointer
> - * @pasid: PASID do identify the VM
> - *
> - * This function is expected to be called in interrupt context.
> - *
> - * Returns:
> - * True if there was fault credit, false otherwise
> - */
> -bool amdgpu_vm_pasid_fault_credit(struct amdgpu_device *adev,
> -				  unsigned int pasid)
> -{
> -	struct amdgpu_vm *vm;
> -
> -	spin_lock(&adev->vm_manager.pasid_lock);
> -	vm = idr_find(&adev->vm_manager.pasid_idr, pasid);
> -	if (!vm) {
> -		/* VM not found, can't track fault credit */
> -		spin_unlock(&adev->vm_manager.pasid_lock);
> -		return true;
> -	}
> -
> -	/* No lock needed. only accessed by IRQ handler */
> -	if (!vm->fault_credit) {
> -		/* Too many faults in this VM */
> -		spin_unlock(&adev->vm_manager.pasid_lock);
> -		return false;
> -	}
> -
> -	vm->fault_credit--;
> -	spin_unlock(&adev->vm_manager.pasid_lock);
> -	return true;
> -}
> -
>   /**
>    * amdgpu_vm_manager_init - init the VM manager
>    *
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> index 2a8898d19c8b..e8dcfd59fc93 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
> @@ -229,9 +229,6 @@ struct amdgpu_vm {
>   	/* Up to 128 pending retry page faults */
>   	DECLARE_KFIFO(faults, u64, 128);
>   
> -	/* Limit non-retry fault storms */
> -	unsigned int		fault_credit;
> -
>   	/* Points to the KFD process VM info */
>   	struct amdkfd_process_info *process_info;
>   
> @@ -299,8 +296,6 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,  int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsigned int pasid);  void amdgpu_vm_release_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm);  void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm); -bool amdgpu_vm_pasid_fault_credit(struct amdgpu_device *adev,
> -				  unsigned int pasid);
>   void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm,
>   			 struct list_head *validated,
>   			 struct amdgpu_bo_list_entry *entry); diff --git a/drivers/gpu/drm/amd/amdgpu/cik_ih.c b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> index b5775c6a857b..3e6c8c4067cb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> @@ -237,23 +237,7 @@ static u32 cik_ih_get_wptr(struct amdgpu_device *adev)
>    */
>   static bool cik_ih_prescreen_iv(struct amdgpu_device *adev)  {
> -	u32 ring_index = adev->irq.ih.rptr >> 2;
> -	u16 pasid;
> -
> -	switch (le32_to_cpu(adev->irq.ih.ring[ring_index]) & 0xff) {
> -	case 146:
> -	case 147:
> -		pasid = le32_to_cpu(adev->irq.ih.ring[ring_index + 2]) >> 16;
> -		if (!pasid || amdgpu_vm_pasid_fault_credit(adev, pasid))
> -			return true;
> -		break;
> -	default:
> -		/* Not a VM fault */
> -		return true;
> -	}
> -
> -	adev->irq.ih.rptr += 16;
> -	return false;
> +	return true;
>   }
>   
>    /**
> diff --git a/drivers/gpu/drm/amd/amdgpu/cz_ih.c b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> index df5ac4d85a00..447b3cbc47e5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> @@ -216,23 +216,7 @@ static u32 cz_ih_get_wptr(struct amdgpu_device *adev)
>    */
>   static bool cz_ih_prescreen_iv(struct amdgpu_device *adev)  {
> -	u32 ring_index = adev->irq.ih.rptr >> 2;
> -	u16 pasid;
> -
> -	switch (le32_to_cpu(adev->irq.ih.ring[ring_index]) & 0xff) {
> -	case 146:
> -	case 147:
> -		pasid = le32_to_cpu(adev->irq.ih.ring[ring_index + 2]) >> 16;
> -		if (!pasid || amdgpu_vm_pasid_fault_credit(adev, pasid))
> -			return true;
> -		break;
> -	default:
> -		/* Not a VM fault */
> -		return true;
> -	}
> -
> -	adev->irq.ih.rptr += 16;
> -	return false;
> +	return true;
>   }
>   
>   /**
> diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> index cf0fc61aebe6..2b94a6d1550e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> @@ -216,23 +216,7 @@ static u32 iceland_ih_get_wptr(struct amdgpu_device *adev)
>    */
>   static bool iceland_ih_prescreen_iv(struct amdgpu_device *adev)  {
> -	u32 ring_index = adev->irq.ih.rptr >> 2;
> -	u16 pasid;
> -
> -	switch (le32_to_cpu(adev->irq.ih.ring[ring_index]) & 0xff) {
> -	case 146:
> -	case 147:
> -		pasid = le32_to_cpu(adev->irq.ih.ring[ring_index + 2]) >> 16;
> -		if (!pasid || amdgpu_vm_pasid_fault_credit(adev, pasid))
> -			return true;
> -		break;
> -	default:
> -		/* Not a VM fault */
> -		return true;
> -	}
> -
> -	adev->irq.ih.rptr += 16;
> -	return false;
> +	return true;
>   }
>   
>   /**
> diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> index dcdbb4d72472..9d7b43da6acc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> @@ -227,23 +227,7 @@ static u32 tonga_ih_get_wptr(struct amdgpu_device *adev)
>    */
>   static bool tonga_ih_prescreen_iv(struct amdgpu_device *adev)  {
> -	u32 ring_index = adev->irq.ih.rptr >> 2;
> -	u16 pasid;
> -
> -	switch (le32_to_cpu(adev->irq.ih.ring[ring_index]) & 0xff) {
> -	case 146:
> -	case 147:
> -		pasid = le32_to_cpu(adev->irq.ih.ring[ring_index + 2]) >> 16;
> -		if (!pasid || amdgpu_vm_pasid_fault_credit(adev, pasid))
> -			return true;
> -		break;
> -	default:
> -		/* Not a VM fault */
> -		return true;
> -	}
> -
> -	adev->irq.ih.rptr += 16;
> -	return false;
> +	return true;
>   }
>   
>   /**
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> index d84b687240d1..b49290bcf109 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> @@ -258,12 +258,9 @@ static bool vega10_ih_prescreen_iv(struct amdgpu_device *adev)
>   	if (!pasid)
>   		return true;
>   
> -	/* Not a retry fault, check fault credit */
> -	if (!(dw5 & 0x80)) {
> -		if (!amdgpu_vm_pasid_fault_credit(adev, pasid))
> -			goto ignore_iv;
> +	/* Not a retry fault */
> +	if (!(dw5 & 0x80))
>   		return true;
> -	}
>   
>   	/* Track retry faults in per-VM fault FIFO. */
>   	spin_lock(&adev->vm_manager.pasid_lock);
> --
> 2.17.1
>
> _______________________________________________
> 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:[~2018-12-01 13:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 12:35 [PATCH 01/11] drm/amdgpu: add missing error handling Christian König
     [not found] ` <20181130123558.14898-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 12:35   ` [PATCH 02/11] drm/amdgpu: send IVs to the KFD only after processing them v2 Christian König
     [not found]     ` <20181130123558.14898-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:02       ` Alex Deucher
     [not found]         ` <CADnq5_OipWaH0=BMMmzJMu-gUKZt-L=nG4Dkt2GWQgMnCKxG1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-30 16:31           ` Kuehling, Felix
     [not found]             ` <DM5PR12MB17078A9132DCA1AD4920300192D30-2J9CzHegvk9TCtO+SvGBKwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-12-01 14:11               ` Christian König
     [not found]                 ` <b2792f9c-127a-b738-9e11-400525b00ed2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-12-03 16:31                   ` Kuehling, Felix
     [not found]                     ` <2c58d93f-7f41-9511-b3f8-2a5f89eff6c9-5C7GfCeVMHo@public.gmane.org>
2018-12-03 16:35                       ` Christian König
     [not found]                         ` <842543c4-f4ed-bff9-eaf5-2b8f8085ed81-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-12-03 16:38                           ` Koenig, Christian
2018-11-30 20:55       ` Zeng, Oak
     [not found]         ` <BN6PR12MB1651C628F04CBC8AD670590A80D30-/b2+HYfkarRSqX7PDniLCgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-12-01 14:16           ` Christian König
2018-11-30 12:35   ` [PATCH 03/11] drm/amdgpu: remove VM fault_credit handling Christian König
     [not found]     ` <20181130123558.14898-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:04       ` Alex Deucher
2018-11-30 21:07       ` Zeng, Oak
     [not found]         ` <BN6PR12MB1651C10E3977C786DE29BB1980D30-/b2+HYfkarRSqX7PDniLCgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-12-01 13:59           ` Christian König [this message]
2018-11-30 12:35   ` [PATCH 04/11] drm/amdgpu: move IV prescreening into the GMC code Christian König
     [not found]     ` <20181130123558.14898-4-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:05       ` Alex Deucher
2018-11-30 12:35   ` [PATCH 05/11] drm/amdgpu: add IH ring to ih_get_wptr/ih_set_rptr v2 Christian König
     [not found]     ` <20181130123558.14898-5-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:09       ` Alex Deucher
2018-11-30 12:35   ` [PATCH 06/11] drm/amdgpu: simplify IH programming Christian König
     [not found]     ` <20181130123558.14898-6-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 15:45       ` Alex Deucher
2018-11-30 12:35   ` [PATCH 07/11] drm/amdgpu: enable IH ring 1 and ring 2 v2 Christian König
     [not found]     ` <20181130123558.14898-7-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:01       ` Alex Deucher
     [not found]         ` <CADnq5_MwEqFZsPcgtkpL9vQKLEjqUev51QKtak9nEweNZ5Q7_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-30 16:04           ` Christian König
2018-11-30 12:35   ` [PATCH 08/11] drm/amdgpu: add the IH to the IV trace Christian König
     [not found]     ` <20181130123558.14898-8-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:01       ` Alex Deucher
2018-11-30 12:35   ` [PATCH 09/11] drm/amdgpu: add support for processing IH ring 1 & 2 Christian König
     [not found]     ` <20181130123558.14898-9-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:10       ` Alex Deucher
2018-11-30 12:35   ` [PATCH 10/11] drm/amdgpu: add support for self irq on Vega10 Christian König
     [not found]     ` <20181130123558.14898-10-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:11       ` Alex Deucher
2018-11-30 12:35   ` [PATCH 11/11] drm/amdgpu: disable IH ring 1 & 2 WPTR overflow " Christian König
     [not found]     ` <20181130123558.14898-11-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-11-30 16:11       ` Alex Deucher
2018-11-30 15:41   ` [PATCH 01/11] drm/amdgpu: add missing error handling Alex Deucher

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=858ea885-a6f2-ccb9-692c-086471fc8d2d@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Oak.Zeng-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.