Skip to contentSkip to conversation

drm/amdgpu: Increase hmm range get pages timeout

PATCH Superseded Philip Yang 3 participants 4 messages Jun 6, 2023 – Jun 7, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +2 -2
index 2dadcfe43d03..f7efa582f3ed 100644
@@ -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);
 
Signature · 1 line
2.35.1
#1 lore raw

[AMD Official Use Only - General]

Quoted 31 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Philip Yang
Sent: Tuesday, June 6, 2023 3:57 PM
To: [email protected]
Cc: Yang, Philip <[email protected]>; Kuehling, Felix <[email protected]>
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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +0 -1
index 2dadcfe43d03..f7efa582f3ed 100644
@@ -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
Quoted 5 lines

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

Quoted 7 lines

+ timeout = max((hmm_range->end - hmm_range->start) >> 27,

1UL);
              timeout *= HMM_RANGE_DEFAULT_TIMEOUT;
              timeout = jiffies + msecs_to_jiffies(timeout);

--
2.35.1

#2 lore raw

PATCH v2 1/1 drm/amdgpu: Increase hmm range get pages timeout

In reply to 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +2 -2
index 2dadcfe43d03..081267161d40 100644
@@ -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);
 
Signature · 1 line
2.35.1
Reviewed-by on v2 1/1
#3 lore raw

Am 2023-06-06 um 18:53 schrieb Philip Yang:

Quoted 7 lines

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.

Quoted 19 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +2 -2
index 2dadcfe43d03..081267161d40 100644
@@ -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);