Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm_native: enable memfd_create on FreeBSD #10624

Merged
merged 3 commits into from Jul 29, 2021
Merged

vm_native: enable memfd_create on FreeBSD #10624

merged 3 commits into from Jul 29, 2021

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Jul 28, 2021

FreeBSD >= 13.0 has memfd_create(3) and MFD_HUGETLB, implemented via SHM_ANON.

Similar to https://github.com/yuzu-emu/yuzu/pull/6758

rpcs3/util/vm_native.cpp:302:16: error: no member named 'memfd_create' in the global namespace
                                m_file = ::memfd_create_("2M", c_mfd_huge_2mb);
                                         ~~^
rpcs3/util/vm_native.cpp:34:23: note: expanded from macro 'memfd_create_'
 #define memfd_create_ memfd_create
                       ^
rpcs3/util/vm_native.cpp:308:15: error: no member named 'memfd_create' in the global namespace
                        m_file = ::memfd_create_("", 0);
                                 ~~^
rpcs3/util/vm_native.cpp:34:23: note: expanded from macro 'memfd_create_'
 #define memfd_create_ memfd_create
                       ^
@jbeich jbeich marked this pull request as draft July 29, 2021 00:01
@jbeich jbeich marked this pull request as ready for review July 29, 2021 00:05
Copy link
Contributor

@kd-11 kd-11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kd-11 kd-11 merged commit 3a6399a into RPCS3:master Jul 29, 2021
@Nekotekina
Copy link
Member

Do you know how to check vm_overcommit support on FreeBSD? Second constructor can benefit from memfd as well.

@jbeich
Copy link
Contributor Author

jbeich commented Jul 30, 2021

tuning(7) describes vm.overcommit (example) which may or may not be similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants