* [PATCH v2 1/2] drm/amd: Clarify kdoc for amdgpu.gttsize
@ 2025-01-16 22:00 Mario Limonciello
2025-01-16 22:00 ` [PATCH v2 2/2] drm/amd: Mark amdgpu.gttsize parameter as deprecated and show warnings on use Mario Limonciello
2025-01-16 22:15 ` [PATCH v2 1/2] drm/amd: Clarify kdoc for amdgpu.gttsize Alex Deucher
0 siblings, 2 replies; 4+ messages in thread
From: Mario Limonciello @ 2025-01-16 22:00 UTC (permalink / raw)
To: amd-gfx; +Cc: Mario Limonciello
From: Mario Limonciello <mario.limonciello@amd.com>
Effectively amdgpu.gttsize gets set to ~1/2 of RAM, but that's controlled
by what the TTM page limit is set to. Clarify the kdoc.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index b911653dd8b6..680b272a83c9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -282,7 +282,7 @@ module_param_named(gartsize, amdgpu_gart_size, uint, 0600);
/**
* DOC: gttsize (int)
* Restrict the size of GTT domain (for userspace use) in MiB for testing.
- * The default is -1 (Use 1/2 RAM, minimum value is 3GB).
+ * The default is -1 (Use value specified by TTM).
*/
MODULE_PARM_DESC(gttsize, "Size of the GTT userspace domain in megabytes (-1 = auto)");
module_param_named(gttsize, amdgpu_gtt_size, int, 0600);
--
2.48.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] drm/amd: Mark amdgpu.gttsize parameter as deprecated and show warnings on use
2025-01-16 22:00 [PATCH v2 1/2] drm/amd: Clarify kdoc for amdgpu.gttsize Mario Limonciello
@ 2025-01-16 22:00 ` Mario Limonciello
2025-01-16 22:14 ` Alex Deucher
2025-01-16 22:15 ` [PATCH v2 1/2] drm/amd: Clarify kdoc for amdgpu.gttsize Alex Deucher
1 sibling, 1 reply; 4+ messages in thread
From: Mario Limonciello @ 2025-01-16 22:00 UTC (permalink / raw)
To: amd-gfx; +Cc: Mario Limonciello
From: Mario Limonciello <mario.limonciello@amd.com>
When not set `gttsize` module parameter by default will get the
value to use for the GTT pool from the TTM page limit, which is
set by a separate module parameter.
This inevitably leads to people not sure which one to set when they
want more addressable memory for the GPU, and you'll end up seeing
instructions online saying to set both.
Add some messages to try to guide people both who are using or misusing
the parameters and mark the parameter as deprecated with the plan to
drop it after the next LTS kernel release.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 17 +++++++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 680b272a83c9..31d4b6aebca5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -283,6 +283,7 @@ module_param_named(gartsize, amdgpu_gart_size, uint, 0600);
* DOC: gttsize (int)
* Restrict the size of GTT domain (for userspace use) in MiB for testing.
* The default is -1 (Use value specified by TTM).
+ * This parameter is deprecated and will be removed in the future.
*/
MODULE_PARM_DESC(gttsize, "Size of the GTT userspace domain in megabytes (-1 = auto)");
module_param_named(gttsize, amdgpu_gtt_size, int, 0600);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index e6fc89440210..becdeab369c5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1960,10 +1960,19 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
/* Compute GTT size, either based on TTM limit
* or whatever the user passed on module init.
*/
- if (amdgpu_gtt_size == -1)
- gtt_size = ttm_tt_pages_limit() << PAGE_SHIFT;
- else
- gtt_size = (uint64_t)amdgpu_gtt_size << 20;
+ gtt_size = ttm_tt_pages_limit() << PAGE_SHIFT;
+ if (amdgpu_gtt_size != -1) {
+ uint64_t configured_size = (uint64_t)amdgpu_gtt_size << 20;
+
+ drm_warn(&adev->ddev,
+ "Configuring gttsize via module parameter is deprecated, please use ttm.pages_limit");
+ if (gtt_size != configured_size)
+ drm_warn(&adev->ddev,
+ "GTT size has been set as %llu but TTM size has been set as %llu, this is unusual",
+ configured_size, gtt_size);
+
+ gtt_size = configured_size;
+ }
/* Initialize GTT memory pool */
r = amdgpu_gtt_mgr_init(adev, gtt_size);
--
2.48.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 2/2] drm/amd: Mark amdgpu.gttsize parameter as deprecated and show warnings on use
2025-01-16 22:00 ` [PATCH v2 2/2] drm/amd: Mark amdgpu.gttsize parameter as deprecated and show warnings on use Mario Limonciello
@ 2025-01-16 22:14 ` Alex Deucher
0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2025-01-16 22:14 UTC (permalink / raw)
To: Mario Limonciello; +Cc: amd-gfx, Mario Limonciello
On Thu, Jan 16, 2025 at 5:00 PM Mario Limonciello <superm1@kernel.org> wrote:
>
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> When not set `gttsize` module parameter by default will get the
> value to use for the GTT pool from the TTM page limit, which is
> set by a separate module parameter.
>
> This inevitably leads to people not sure which one to set when they
> want more addressable memory for the GPU, and you'll end up seeing
> instructions online saying to set both.
>
> Add some messages to try to guide people both who are using or misusing
> the parameters and mark the parameter as deprecated with the plan to
> drop it after the next LTS kernel release.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 17 +++++++++++++----
> 2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 680b272a83c9..31d4b6aebca5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -283,6 +283,7 @@ module_param_named(gartsize, amdgpu_gart_size, uint, 0600);
> * DOC: gttsize (int)
> * Restrict the size of GTT domain (for userspace use) in MiB for testing.
> * The default is -1 (Use value specified by TTM).
> + * This parameter is deprecated and will be removed in the future.
> */
> MODULE_PARM_DESC(gttsize, "Size of the GTT userspace domain in megabytes (-1 = auto)");
> module_param_named(gttsize, amdgpu_gtt_size, int, 0600);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index e6fc89440210..becdeab369c5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -1960,10 +1960,19 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
> /* Compute GTT size, either based on TTM limit
> * or whatever the user passed on module init.
> */
> - if (amdgpu_gtt_size == -1)
> - gtt_size = ttm_tt_pages_limit() << PAGE_SHIFT;
> - else
> - gtt_size = (uint64_t)amdgpu_gtt_size << 20;
> + gtt_size = ttm_tt_pages_limit() << PAGE_SHIFT;
> + if (amdgpu_gtt_size != -1) {
> + uint64_t configured_size = (uint64_t)amdgpu_gtt_size << 20;
> +
> + drm_warn(&adev->ddev,
> + "Configuring gttsize via module parameter is deprecated, please use ttm.pages_limit");
Missing newline at the end.
> + if (gtt_size != configured_size)
> + drm_warn(&adev->ddev,
> + "GTT size has been set as %llu but TTM size has been set as %llu, this is unusual",
Same here.
With those fixed:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> + configured_size, gtt_size);
> +
> + gtt_size = configured_size;
> + }
>
> /* Initialize GTT memory pool */
> r = amdgpu_gtt_mgr_init(adev, gtt_size);
> --
> 2.48.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/2] drm/amd: Clarify kdoc for amdgpu.gttsize
2025-01-16 22:00 [PATCH v2 1/2] drm/amd: Clarify kdoc for amdgpu.gttsize Mario Limonciello
2025-01-16 22:00 ` [PATCH v2 2/2] drm/amd: Mark amdgpu.gttsize parameter as deprecated and show warnings on use Mario Limonciello
@ 2025-01-16 22:15 ` Alex Deucher
1 sibling, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2025-01-16 22:15 UTC (permalink / raw)
To: Mario Limonciello; +Cc: amd-gfx, Mario Limonciello
On Thu, Jan 16, 2025 at 5:07 PM Mario Limonciello <superm1@kernel.org> wrote:
>
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> Effectively amdgpu.gttsize gets set to ~1/2 of RAM, but that's controlled
> by what the TTM page limit is set to. Clarify the kdoc.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index b911653dd8b6..680b272a83c9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -282,7 +282,7 @@ module_param_named(gartsize, amdgpu_gart_size, uint, 0600);
> /**
> * DOC: gttsize (int)
> * Restrict the size of GTT domain (for userspace use) in MiB for testing.
> - * The default is -1 (Use 1/2 RAM, minimum value is 3GB).
> + * The default is -1 (Use value specified by TTM).
> */
> MODULE_PARM_DESC(gttsize, "Size of the GTT userspace domain in megabytes (-1 = auto)");
> module_param_named(gttsize, amdgpu_gtt_size, int, 0600);
> --
> 2.48.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-16 22:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 22:00 [PATCH v2 1/2] drm/amd: Clarify kdoc for amdgpu.gttsize Mario Limonciello
2025-01-16 22:00 ` [PATCH v2 2/2] drm/amd: Mark amdgpu.gttsize parameter as deprecated and show warnings on use Mario Limonciello
2025-01-16 22:14 ` Alex Deucher
2025-01-16 22:15 ` [PATCH v2 1/2] drm/amd: Clarify kdoc for amdgpu.gttsize Alex Deucher
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.