From ae28a3454870eb2e82870d1e2b15fae9d10bd612 Mon Sep 17 00:00:00 2001 From: Robert Swiecki Date: Fri, 1 Sep 2023 19:47:38 +0200 Subject: [PATCH] libhfcommon/files: try to use MFD_HUGETLB with shared mem --- libhfcommon/files.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libhfcommon/files.c b/libhfcommon/files.c index 5a7763ec9..d0fa72ce0 100644 --- a/libhfcommon/files.c +++ b/libhfcommon/files.c @@ -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)); }