All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: limit the number of dst address in trace
@ 2022-01-17  7:55 Somalapuram Amaranath
  2022-01-17  7:58 ` Christian König
  0 siblings, 1 reply; 6+ messages in thread
From: Somalapuram Amaranath @ 2022-01-17  7:55 UTC (permalink / raw)
  To: amd-gfx
  Cc: alexander.deucher, Somalapuram Amaranath, christian.koenig,
	shashank.sharma

trace_amdgpu_vm_update_ptes trace unable to log when nptes too large

Signed-off-by: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 5 ++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c    | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
index d855cb53c7e0..a48b34d4ce31 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
@@ -358,11 +358,10 @@ TRACE_EVENT(amdgpu_vm_update_ptes,
 			}
 	),
 	TP_printk("pid:%u vm_ctx:0x%llx start:0x%010llx end:0x%010llx,"
-		  " flags:0x%llx, incr:%llu, dst:\n%s%s", __entry->pid,
+		  " flags:0x%llx, incr:%llu, dst:\n%s", __entry->pid,
 		  __entry->vm_ctx, __entry->start, __entry->end,
 		  __entry->flags, __entry->incr,  __print_array(
-		  __get_dynamic_array(dst), min(__entry->nptes, 32u), 8),
-		  __entry->nptes > 32 ? "..." : "")
+		  __get_dynamic_array(dst), __entry->nptes, 8))
 );
 
 TRACE_EVENT(amdgpu_vm_set_ptes,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 0e7dc23f78e7..f367fcc5c535 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1634,7 +1634,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
 			nptes = max(nptes, 1u);
 
 			trace_amdgpu_vm_update_ptes(params, frag_start, upd_end,
-						    nptes, dst, incr, upd_flags,
+						    min(nptes, 32u), dst, incr, upd_flags,
 						    vm->task_info.pid,
 						    vm->immediate.fence_context);
 			amdgpu_vm_update_flags(params, to_amdgpu_bo_vm(pt),
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: limit the number of dst address in trace
  2022-01-17  7:55 [PATCH] drm/amdgpu: limit the number of dst address in trace Somalapuram Amaranath
@ 2022-01-17  7:58 ` Christian König
  0 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2022-01-17  7:58 UTC (permalink / raw)
  To: Somalapuram Amaranath, amd-gfx; +Cc: alexander.deucher, shashank.sharma

Am 17.01.22 um 08:55 schrieb Somalapuram Amaranath:
> trace_amdgpu_vm_update_ptes trace unable to log when nptes too large
>
> Signed-off-by: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 5 ++---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c    | 2 +-
>   2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
> index d855cb53c7e0..a48b34d4ce31 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
> @@ -358,11 +358,10 @@ TRACE_EVENT(amdgpu_vm_update_ptes,
>   			}
>   	),
>   	TP_printk("pid:%u vm_ctx:0x%llx start:0x%010llx end:0x%010llx,"
> -		  " flags:0x%llx, incr:%llu, dst:\n%s%s", __entry->pid,
> +		  " flags:0x%llx, incr:%llu, dst:\n%s", __entry->pid,
>   		  __entry->vm_ctx, __entry->start, __entry->end,
>   		  __entry->flags, __entry->incr,  __print_array(
> -		  __get_dynamic_array(dst), min(__entry->nptes, 32u), 8),
> -		  __entry->nptes > 32 ? "..." : "")
> +		  __get_dynamic_array(dst), __entry->nptes, 8))
>   );
>   
>   TRACE_EVENT(amdgpu_vm_set_ptes,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 0e7dc23f78e7..f367fcc5c535 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1634,7 +1634,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
>   			nptes = max(nptes, 1u);
>   
>   			trace_amdgpu_vm_update_ptes(params, frag_start, upd_end,
> -						    nptes, dst, incr, upd_flags,
> +						    min(nptes, 32u), dst, incr, upd_flags,
>   						    vm->task_info.pid,
>   						    vm->immediate.fence_context);
>   			amdgpu_vm_update_flags(params, to_amdgpu_bo_vm(pt),


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: limit the number of dst address in trace
  2022-01-17  6:32 Somalapuram Amaranath
@ 2022-01-17  7:24 ` Christian König
  0 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2022-01-17  7:24 UTC (permalink / raw)
  To: Somalapuram Amaranath, amd-gfx; +Cc: alexander.deucher, shashank.sharma



Am 17.01.22 um 07:32 schrieb Somalapuram Amaranath:
> trace_amdgpu_vm_update_ptes trace unable to log when nptes too large
>
> Signed-off-by: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 0e7dc23f78e7..f367fcc5c535 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1634,7 +1634,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
>   			nptes = max(nptes, 1u);
>   
>   			trace_amdgpu_vm_update_ptes(params, frag_start, upd_end,
> -						    nptes, dst, incr, upd_flags,
> +						    min(nptes, 32u), dst, incr, upd_flags,

You still need to remove the same workaround in amdgpu_trace.h.

E.g. something like this:

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
index d855cb53c7e0..a48b34d4ce31 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
@@ -358,11 +358,10 @@ TRACE_EVENT(amdgpu_vm_update_ptes,
                         }
         ),
         TP_printk("pid:%u vm_ctx:0x%llx start:0x%010llx end:0x%010llx,"
-                 " flags:0x%llx, incr:%llu, dst:\n%s%s", __entry->pid,
+                 " flags:0x%llx, incr:%llu, dst:\n%s", __entry->pid,
                   __entry->vm_ctx, __entry->start, __entry->end,
                   __entry->flags, __entry->incr, __print_array(
-                 __get_dynamic_array(dst), min(__entry->nptes, 32u), 8),
-                 __entry->nptes > 32 ? "..." : "")
+                 __get_dynamic_array(dst), __entry->nptes, 8))
  );

  TRACE_EVENT(amdgpu_vm_set_ptes,

Regards,
Christian.



>   						    vm->task_info.pid,
>   						    vm->immediate.fence_context);
>   			amdgpu_vm_update_flags(params, to_amdgpu_bo_vm(pt),


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/amdgpu: limit the number of dst address in trace
@ 2022-01-17  6:32 Somalapuram Amaranath
  2022-01-17  7:24 ` Christian König
  0 siblings, 1 reply; 6+ messages in thread
From: Somalapuram Amaranath @ 2022-01-17  6:32 UTC (permalink / raw)
  To: amd-gfx
  Cc: alexander.deucher, Somalapuram Amaranath, christian.koenig,
	shashank.sharma

trace_amdgpu_vm_update_ptes trace unable to log when nptes too large

Signed-off-by: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 0e7dc23f78e7..f367fcc5c535 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1634,7 +1634,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
 			nptes = max(nptes, 1u);
 
 			trace_amdgpu_vm_update_ptes(params, frag_start, upd_end,
-						    nptes, dst, incr, upd_flags,
+						    min(nptes, 32u), dst, incr, upd_flags,
 						    vm->task_info.pid,
 						    vm->immediate.fence_context);
 			amdgpu_vm_update_flags(params, to_amdgpu_bo_vm(pt),
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: limit the number of dst address in trace
  2022-01-11  7:09 Somalapuram Amaranath
@ 2022-01-11 11:01 ` Christian König
  0 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2022-01-11 11:01 UTC (permalink / raw)
  To: Somalapuram Amaranath, amd-gfx; +Cc: alexander.deucher, christian.koenig



Am 11.01.22 um 08:09 schrieb Somalapuram Amaranath:
> trace_amdgpu_vm_update_ptes trace unable to log when nptes too large
>
> Signed-off-by: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 0e7dc23f78e7..0630bd43238c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1632,6 +1632,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
>   			 * silent to stop fault floods.
>   			 */
>   			nptes = max(nptes, 1u);
> +			nptes = nptes > 32 ? 32 : nptes;

Please do something like min(nptes, 32) in the parameter list of 
trace_amdgpu_vm_update_ptes instead. I'm not sure if the nptes are not 
needed any more after this.

Then please also remove the previous workaround in amdgpu_trace.h.

Apart from that sounds like the right idea to me.

Christian.

>   
>   			trace_amdgpu_vm_update_ptes(params, frag_start, upd_end,
>   						    nptes, dst, incr, upd_flags,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] drm/amdgpu: limit the number of dst address in trace
@ 2022-01-11  7:09 Somalapuram Amaranath
  2022-01-11 11:01 ` Christian König
  0 siblings, 1 reply; 6+ messages in thread
From: Somalapuram Amaranath @ 2022-01-11  7:09 UTC (permalink / raw)
  To: amd-gfx; +Cc: alexander.deucher, Somalapuram Amaranath, christian.koenig

trace_amdgpu_vm_update_ptes trace unable to log when nptes too large

Signed-off-by: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 0e7dc23f78e7..0630bd43238c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1632,6 +1632,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
 			 * silent to stop fault floods.
 			 */
 			nptes = max(nptes, 1u);
+			nptes = nptes > 32 ? 32 : nptes;
 
 			trace_amdgpu_vm_update_ptes(params, frag_start, upd_end,
 						    nptes, dst, incr, upd_flags,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-17  7:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17  7:55 [PATCH] drm/amdgpu: limit the number of dst address in trace Somalapuram Amaranath
2022-01-17  7:58 ` Christian König
  -- strict thread matches above, loose matches on Subject: below --
2022-01-17  6:32 Somalapuram Amaranath
2022-01-17  7:24 ` Christian König
2022-01-11  7:09 Somalapuram Amaranath
2022-01-11 11:01 ` Christian König

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.