Skip to content

Commit

Permalink
libhfcommon/files: try to use MFD_HUGETLB with shared mem
Browse files Browse the repository at this point in the history
  • Loading branch information
robertswiecki committed Sep 1, 2023
1 parent 8b99dc0 commit ae28a34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libhfcommon/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ int files_createSharedMem(size_t sz, const char* name, bool exportmap) {
}

#if defined(_HF_ARCH_LINUX)
if (fd == -1) {
fd = syscall(__NR_memfd_create, name, (uintptr_t)(MFD_CLOEXEC | MFD_HUGETLB));
}
if (fd == -1) {
fd = syscall(__NR_memfd_create, name, (uintptr_t)(MFD_CLOEXEC));
}
Expand Down

0 comments on commit ae28a34

Please sign in to comment.