linux/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
/* Set memory usage limits. Current, limits are
 *  System (kernel) memory - 3/8th System RAM
 *  Userptr memory - 3/4th System RAM
 */
Set memory usage limits. Current, limits are
System (kernel) memory - 3/8th System RAM
Userptr memory - 3/4th System RAM
Set memory usage limits . Current limits are System ( kernel ) memory - 3 / 8th System RAM Userptr memory - 3 / 4th System RAM
void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
{
	struct sysinfo si;
	uint64_t mem;
	si_meminfo(&si);
	mem = si.totalram - si.totalhigh;
	mem *= si.mem_unit;
	spin_lock_init(&kfd_mem_limit.mem_limit_lock);
	kfd_mem_limit.max_system_mem_limit = (mem >> 1) - (mem >> 3);
	kfd_mem_limit.max_userptr_mem_limit = mem - (mem >> 2);
	pr_debug("Kernel memory limit %lluM, userptr limit %lluM\n",
		(kfd_mem_limit.max_system_mem_limit >> 20),
		(kfd_mem_limit.max_userptr_mem_limit >> 20));
}
void amdgpu_amdkfd_gpuvm_init_mem_limits ( void ) { struct sysinfo si ; uint64_t mem ; si_meminfo ( & si ) ; mem = si . totalram - si . totalhigh ; mem *= si . mem_unit ; spin_lock_init ( & kfd_mem_limit . mem_limit_lock ) ; kfd_mem_limit . max_system_mem_limit = ( mem >> 1 ) - ( mem >> 3 ) ; kfd_mem_limit . max_userptr_mem_limit = mem - ( mem >> 2 ) ; pr_debug ( " \n " , ( kfd_mem_limit . max_system_mem_limit >> 20 ) , ( kfd_mem_limit . max_userptr_mem_limit >> 20 ) ) ; }
Set memory usage limits.
Set memory usage limits .