[Intel-xe] [PATCH] drm/xe: Limit system memory size of half of system memory

Matthew Auld matthew.auld at intel.com
Wed Apr 26 16:47:26 UTC 2023


On 26/04/2023 17:44, José Roberto de Souza wrote:
> ttm_global_init() imposes this limitation.
> 
> Cc: Matthew Auld <matthew.auld at intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_ttm_sys_mgr.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c b/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c
> index 5b0674bbb8ed0..3e1fa0c832cab 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c
> +++ b/drivers/gpu/drm/xe/xe_ttm_sys_mgr.c
> @@ -105,7 +105,10 @@ int xe_ttm_sys_mgr_init(struct xe_device *xe)
>   	u64 gtt_size;
>   
>   	si_meminfo(&si);
> -	gtt_size = (u64)si.totalram * si.mem_unit * 3/4;
> +	gtt_size = (u64)si.totalram * si.mem_unit;
> +	/* TTM limits allocation of all TTM devices by 50% of system memory */
> +	gtt_size /= 2;

Beat me to it. That indeed makes more sense,
Reviewed-by: Matthew Auld <matthew.auld at intel.com>

> +
>   	man->use_tt = true;
>   	man->func = &xe_ttm_sys_mgr_func;
>   	ttm_resource_manager_init(man, &xe->ttm, gtt_size >> PAGE_SHIFT);


More information about the Intel-xe mailing list