All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: increase hmm range get pages timeout
@ 2023-12-08 23:01 James Zhu
  2023-12-08 23:01 ` [PATCH 2/2] drm/amdgpu: make an improvement on amdgpu_hmm_range_get_pages James Zhu
  2023-12-13 15:24 ` [PATCH 1/2] drm/amdgpu: increase hmm range get pages timeout James Zhu
  0 siblings, 2 replies; 10+ messages in thread
From: James Zhu @ 2023-12-08 23:01 UTC (permalink / raw)
  To: amd-gfx; +Cc: Philip.Yang, Felix.kuehling, jamesz, christian.koenig

When application tries to allocate all system memory and cause memory
to swap out. Needs more time for hmm_range_fault to validate the
remaining page for allocation. To be safe, increase timeout value to
1 second for 64MB range.

Signed-off-by: James Zhu <James.Zhu@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 081267161d40..b24eb5821fd1 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 128MB takes maximum 1 second to fault page address */
-		timeout = max((hmm_range->end - hmm_range->start) >> 27, 1UL);
+		/* Assuming 64MB takes maximum 1 second to fault page address */
+		timeout = max((hmm_range->end - hmm_range->start) >> 26, 1UL);
 		timeout *= HMM_RANGE_DEFAULT_TIMEOUT;
 		timeout = jiffies + msecs_to_jiffies(timeout);
 
-- 
2.25.1


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

end of thread, other threads:[~2023-12-13 16:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 23:01 [PATCH 1/2] drm/amdgpu: increase hmm range get pages timeout James Zhu
2023-12-08 23:01 ` [PATCH 2/2] drm/amdgpu: make an improvement on amdgpu_hmm_range_get_pages James Zhu
2023-12-11 10:38   ` Christian König
2023-12-11 17:23     ` James Zhu
2023-12-11 23:43     ` Felix Kuehling
2023-12-12  8:43       ` Christian König
2023-12-11 20:02   ` [PATCH v2 " James Zhu
2023-12-13 15:24 ` [PATCH 1/2] drm/amdgpu: increase hmm range get pages timeout James Zhu
2023-12-13 16:23   ` Felix Kuehling
2023-12-13 16:55     ` James Zhu

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.