]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Use free system memory size for kfd memory accounting
authorOak Zeng <Oak.Zeng@amd.com>
Mon, 18 Jan 2021 20:55:34 +0000 (14:55 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Mar 2021 02:57:49 +0000 (22:57 -0400)
commit970c91eb37c7e70b53e8ad1a2b3e2c482e9ee416
tree4e5262bb79f40e448d57561e04969ed656ebc0bc
parent045d37006986d6827babdc85b62008a424dc78b6
drm/amdgpu: Use free system memory size for kfd memory accounting

With the current kfd memory accounting scheme, kfd applications
can use up to 15/16 of total system memory. For system which
has small total system memory size it leaves small system memory
for OS. For example, if the system has totally 16GB of system
memory, this scheme leave OS and non-kfd applications only 1GB
of system memory. In many cases, this leads to OOM killer.

This patch changed the KFD system memory accounting scheme.
15/16 of free system memory when kfd driver load. This deduct
the system memory that OS already use.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Suggested-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c