From 0c86767cf213035f26e594c32f23047b94ec5c60 Mon Sep 17 00:00:00 2001 From: Felix Kuehling Date: Tue, 16 Apr 2019 23:31:28 -0400 Subject: [PATCH] libhsakmt: Enable HSA_USERPTR_FOR_PAGED_MEM by default By using user-allocated pages instead of kernel-allocated pages from TTM, we're not subject to TTM's self imposed limits on kernel memory usage. This also paves the way for for more wide-spread use of HMM on upstream kernels. Change-Id: Iac82964c98a441e29b7f1986d1be1bb5ccb1e569 Signed-off-by: Felix Kuehling [ROCm/ROCR-Runtime commit: 626957a2631718526b788f12ae9478ea7be89c3d] --- projects/rocr-runtime/src/fmm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/rocr-runtime/src/fmm.c b/projects/rocr-runtime/src/fmm.c index dc24b61bbc..0bdb6f3c96 100644 --- a/projects/rocr-runtime/src/fmm.c +++ b/projects/rocr-runtime/src/fmm.c @@ -2093,11 +2093,11 @@ HSAKMT_STATUS fmm_init_process_apertures(unsigned int NumNodes) disableCache = getenv("HSA_DISABLE_CACHE"); svm.disable_cache = (disableCache && strcmp(disableCache, "0")); - /* If HSA_USERPTR_FOR_PAGED_MEM is set to a non-0 value, - * enable userptr for all paged memory allocations + /* If HSA_USERPTR_FOR_PAGED_MEM is not set or set to a non-0 + * value, enable userptr for all paged memory allocations */ pagedUserptr = getenv("HSA_USERPTR_FOR_PAGED_MEM"); - svm.userptr_for_paged_mem = (pagedUserptr && strcmp(pagedUserptr, "0")); + svm.userptr_for_paged_mem = (!pagedUserptr || strcmp(pagedUserptr, "0")); /* If HSA_CHECK_USERPTR is set to a non-0 value, check all userptrs * when they are registered