drm/amdgpu: Raise KFD unpinned system memory limit
authorFelix Kuehling <Felix.Kuehling@amd.com>
Mon, 25 Nov 2019 21:25:35 +0000 (16:25 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Nov 2019 19:51:03 +0000 (14:51 -0500)
Allow KFD applications to use more unpinned system memory through
HMM.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

index a1ed8a8..c2f92a7 100644 (file)
@@ -85,7 +85,7 @@ static bool check_if_add_bo_to_vm(struct amdgpu_vm *avm,
 }
 
 /* Set memory usage limits. Current, limits are
- *  System (TTM + userptr) memory - 3/4th System RAM
+ *  System (TTM + userptr) memory - 15/16th System RAM
  *  TTM memory - 3/8th System RAM
  */
 void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
@@ -98,7 +98,7 @@ void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
        mem *= si.mem_unit;
 
        spin_lock_init(&kfd_mem_limit.mem_limit_lock);
-       kfd_mem_limit.max_system_mem_limit = (mem >> 1) + (mem >> 2);
+       kfd_mem_limit.max_system_mem_limit = mem - (mem >> 4);
        kfd_mem_limit.max_ttm_mem_limit = (mem >> 1) - (mem >> 3);
        pr_debug("Kernel memory limit %lluM, TTM limit %lluM\n",
                (kfd_mem_limit.max_system_mem_limit >> 20),