From c99195128809d53ba05e17ebfaec426ef47135eb Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Tue, 28 Feb 2017 12:36:30 -0500 Subject: [PATCH] fmm.c: Disable userptr for paged mem by default Unless HSA_USERPTR_FOR_PAGED_MEM is explicitly set, don't use userptr for all paged memory. This will also allow us to work around some 4.9 issues, and then we can explicitly set HSA_USERPTR_FOR_PAGED_MEM for all usage once those issues are resolved. Change-Id: I25ce22b73ae6e93f1567f2318d9d2b47d4a44e69 --- src/fmm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmm.c b/src/fmm.c index 067b9c28c1..1a10aa82d2 100644 --- a/src/fmm.c +++ b/src/fmm.c @@ -1400,10 +1400,10 @@ HSAKMT_STATUS fmm_init_process_apertures(unsigned int NumNodes) if (disableCache && strcmp(disableCache, "0") == 0) disableCache = NULL; - /* If HSA_USERPTR_FOR_PAGED_MEM unset or set to a non-0 value, + /* If HSA_USERPTR_FOR_PAGED_MEM is 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")); /* Trade off - NumNodes includes GPU nodes + CPU Node. So in * systems with CPU node, slightly more memory is allocated than