libhsakmt: call madvise() from fmm_allocate_device
This is needed to avoid additional references to mapped BOs in child processes that can prevent freeing memory in the parent process and lead to out-of-memory conditions. Change-Id: I25c90510a14dde515cc23ea5dc1f68e8d7e37a66 Signed-off-by: Philip Cox <Philip.Cox@amd.com>
This commit is contained in:
@@ -1361,6 +1361,13 @@ void *fmm_allocate_device(uint32_t gpu_id, void *address, uint64_t MemorySizeInB
|
||||
__fmm_release(vm_obj, aperture);
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
* This madvise() call is needed to avoid additional references
|
||||
* to mapped BOs in child processes that can prevent freeing
|
||||
* memory in the parent process and lead to out-of-memory
|
||||
* conditions.
|
||||
*/
|
||||
madvise(mem, MemorySizeInBytes, MADV_DONTFORK);
|
||||
}
|
||||
|
||||
return mem;
|
||||
|
||||
Verwijs in nieuw issue
Block a user