Closed kcgthb closed 5 years ago
@kcgthb does the kernel support the syscall? If yes, we should just do a raw syscall instead.
Ah that's a good point, indeed. It looks like kernel 3.10.0-957.27.2.el7.x86_64
(the latest CentOS 7.x kernel) does indeed support the memfd_create(2)
syscall, only the glibc wrapper is missing.
But I haven't checked older kernel revisions, and they may not.
So in the interest of supporting more kernel versions, and without having to distinguish between cases where the kernel supports the syscall but the glibc doesn't provide the wrapper, and where none does, maybe a graceful fallback would be a good approach too? It's definitely less elegant and efficient, but it doesn't depend on memfd_create()
at all, so it may support older systems too.
Looks like it was added in CentOS 7.3, I think it's old enough to make this version the minimum requirement. I would rather have a single syscall (behind a wrapper for CentOS/RHEL), than two different syscalls. I'll take a stab at a simple patch doing the syscall wrapper.
Would that be fine for you?
On Tue, Sep 3, 2019 at 8:15 AM Kilian Cavalotti notifications@github.com wrote:
Ah that's a good point, indeed. It looks like kernel 3.10.0-957.27.2.el7.x86_64 (the latest CentOS 7.x kernel) does indeed support the memfd_create(2) syscall, only the glibc wrapper is missing.
But I haven't checked older kernel revisions, and they may not.
So in the interest of supporting more kernel versions, and without having to distinguish between cases where the kernel supports the syscall but the glibc doesn't provide the wrapper, and where none does, maybe a graceful fallback would be a good approach too? It's definitely less elegant and efficient, but it doesn't depend on memfd_create() at all, so it may support older systems too.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NVIDIA/pyxis/pull/3?email_source=notifications&email_token=AA32BDOPJCBHVROQTHMFQ4TQHZ5R7A5CNFSM4ISSC7Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5YRLYI#issuecomment-527504865, or mute the thread https://github.com/notifications/unsubscribe-auth/AA32BDPBZQ6QJB64OHNBGTLQHZ5R7ANCNFSM4ISSC7QQ .
-- Félix Abecassis http://felix.abecassis.me
Would that be fine for you?
Yup, that'd be perfect, thanks!
It turns out that RHEL/CentOS 7.x doesn't properly backported
memfd_create()
, so this patch proposes a fallback in casememfd_create()
is not available.Signed-off-by: Kilian Cavalotti kilian@stanford.edu