All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Increase hmm range get pages timeout
@ 2023-06-06 19:57 Philip Yang
  2023-06-06 19:59 ` Russell, Kent
  2023-06-06 22:53 ` [PATCH v2] " Philip Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Philip Yang @ 2023-06-06 19:57 UTC (permalink / raw)
  To: amd-gfx; +Cc: Philip Yang, Felix.Kuehling

If hmm_range_fault returns -EBUSY, we should call hmm_range_fault again
to validate the remaining pages. On one system with NUMA auto balancing
enabled, hmm_range_fault takes 6 seconds for 1GB range because CPU
migrate the range one page at a time. To be safe, increase timeout value
to 1 second for 128MB range.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
index 2dadcfe43d03..f7efa582f3ed 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
@@ -190,8 +190,8 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
 		pr_debug("hmm range: start = 0x%lx, end = 0x%lx",
 			hmm_range->start, hmm_range->end);
 
-		/* Assuming 512MB takes maxmium 1 second to fault page address */
-		timeout = max((hmm_range->end - hmm_range->start) >> 29, 1UL);
+		/* Assuming 128MB takes maxmium 1 second to fault page address */
+		timeout = max((hmm_range->end - hmm_range->start) >> 27, 1UL);
 		timeout *= HMM_RANGE_DEFAULT_TIMEOUT;
 		timeout = jiffies + msecs_to_jiffies(timeout);
 
-- 
2.35.1


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

* RE: [PATCH] drm/amdgpu: Increase hmm range get pages timeout
  2023-06-06 19:57 [PATCH] drm/amdgpu: Increase hmm range get pages timeout Philip Yang
@ 2023-06-06 19:59 ` Russell, Kent
  2023-06-06 22:53 ` [PATCH v2] " Philip Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Russell, Kent @ 2023-06-06 19:59 UTC (permalink / raw)
  To: Yang, Philip, amd-gfx; +Cc: Yang, Philip, Kuehling, Felix

[AMD Official Use Only - General]

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Philip
> Yang
> Sent: Tuesday, June 6, 2023 3:57 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Yang, Philip <Philip.Yang@amd.com>; Kuehling, Felix
> <Felix.Kuehling@amd.com>
> Subject: [PATCH] drm/amdgpu: Increase hmm range get pages timeout
>
> If hmm_range_fault returns -EBUSY, we should call hmm_range_fault again
> to validate the remaining pages. On one system with NUMA auto balancing
> enabled, hmm_range_fault takes 6 seconds for 1GB range because CPU
> migrate the range one page at a time. To be safe, increase timeout value
> to 1 second for 128MB range.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
> index 2dadcfe43d03..f7efa582f3ed 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
> @@ -190,8 +190,8 @@ int amdgpu_hmm_range_get_pages(struct
> mmu_interval_notifier *notifier,
>               pr_debug("hmm range: start = 0x%lx, end = 0x%lx",
>                       hmm_range->start, hmm_range->end);
>
> -             /* Assuming 512MB takes maxmium 1 second to fault page
> address */
> -             timeout = max((hmm_range->end - hmm_range->start) >> 29,
> 1UL);
> +             /* Assuming 128MB takes maxmium 1 second to fault page
> address */

Since we're changing the line anyways, can we fix maxmium->maximum ?

 Kent

> +             timeout = max((hmm_range->end - hmm_range->start) >> 27,
> 1UL);
>               timeout *= HMM_RANGE_DEFAULT_TIMEOUT;
>               timeout = jiffies + msecs_to_jiffies(timeout);
>
> --
> 2.35.1


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

* [PATCH v2] drm/amdgpu: Increase hmm range get pages timeout
  2023-06-06 19:57 [PATCH] drm/amdgpu: Increase hmm range get pages timeout Philip Yang
  2023-06-06 19:59 ` Russell, Kent
@ 2023-06-06 22:53 ` Philip Yang
  2023-06-07 13:22   ` Felix Kuehling
  1 sibling, 1 reply; 4+ messages in thread
From: Philip Yang @ 2023-06-06 22:53 UTC (permalink / raw)
  To: amd-gfx; +Cc: Philip Yang, Felix.Kuehling

If hmm_range_fault returns -EBUSY, we should call hmm_range_fault again
to validate the remaining pages. On one system with NUMA auto balancing
enabled, hmm_range_fault takes 6 seconds for 1GB range because CPU
migrate the range one page at a time. To be safe, increase timeout value
to 1 second for 128MB range.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
index 2dadcfe43d03..081267161d40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
@@ -190,8 +190,8 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
 		pr_debug("hmm range: start = 0x%lx, end = 0x%lx",
 			hmm_range->start, hmm_range->end);
 
-		/* Assuming 512MB takes maxmium 1 second to fault page address */
-		timeout = max((hmm_range->end - hmm_range->start) >> 29, 1UL);
+		/* Assuming 128MB takes maximum 1 second to fault page address */
+		timeout = max((hmm_range->end - hmm_range->start) >> 27, 1UL);
 		timeout *= HMM_RANGE_DEFAULT_TIMEOUT;
 		timeout = jiffies + msecs_to_jiffies(timeout);
 
-- 
2.35.1


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

* Re: [PATCH v2] drm/amdgpu: Increase hmm range get pages timeout
  2023-06-06 22:53 ` [PATCH v2] " Philip Yang
@ 2023-06-07 13:22   ` Felix Kuehling
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Kuehling @ 2023-06-07 13:22 UTC (permalink / raw)
  To: Philip Yang, amd-gfx


Am 2023-06-06 um 18:53 schrieb Philip Yang:
> If hmm_range_fault returns -EBUSY, we should call hmm_range_fault again
> to validate the remaining pages. On one system with NUMA auto balancing
> enabled, hmm_range_fault takes 6 seconds for 1GB range because CPU
> migrate the range one page at a time. To be safe, increase timeout value
> to 1 second for 128MB range.
>
> Signed-off-by: Philip Yang <Philip.Yang@amd.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>


> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
> index 2dadcfe43d03..081267161d40 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c
> @@ -190,8 +190,8 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
>   		pr_debug("hmm range: start = 0x%lx, end = 0x%lx",
>   			hmm_range->start, hmm_range->end);
>   
> -		/* Assuming 512MB takes maxmium 1 second to fault page address */
> -		timeout = max((hmm_range->end - hmm_range->start) >> 29, 1UL);
> +		/* Assuming 128MB takes maximum 1 second to fault page address */
> +		timeout = max((hmm_range->end - hmm_range->start) >> 27, 1UL);
>   		timeout *= HMM_RANGE_DEFAULT_TIMEOUT;
>   		timeout = jiffies + msecs_to_jiffies(timeout);
>   

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

end of thread, other threads:[~2023-06-07 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-06 19:57 [PATCH] drm/amdgpu: Increase hmm range get pages timeout Philip Yang
2023-06-06 19:59 ` Russell, Kent
2023-06-06 22:53 ` [PATCH v2] " Philip Yang
2023-06-07 13:22   ` Felix Kuehling

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.