Skip to content

Fixed mmap on OpenBSD#139

Merged
tevador merged 1 commit intotevador:masterfrom
ston1th:fix_openbsd_mmap
Oct 23, 2019
Merged

Fixed mmap on OpenBSD#139
tevador merged 1 commit intotevador:masterfrom
ston1th:fix_openbsd_mmap

Conversation

@ston1th
Copy link
Contributor

@ston1th ston1th commented Oct 17, 2019

OpenBSD's mmap does not support MAP_HUGETLB and MAP_POPULATE.

@tevador
Copy link
Owner

tevador commented Oct 17, 2019

Is there no way to allocate huge pages on OpenBSD?

@ston1th
Copy link
Contributor Author

ston1th commented Oct 17, 2019

I dont think so.
The manpage does not mention any of them: https://man.openbsd.org/mmap

Edit: I have found these by trying to compile the latest monerod on OpenBSD.

@tevador
Copy link
Owner

tevador commented Oct 19, 2019

Perhaps the best solution would be this:

#elif defined(__OpenBSD__)
      mem = MAP_FAILED; //hugepages not supported

Like this, the allocator would not lie about having successfully allocated large pages. In monerod, it would automatically fall back to the C++ allocator (and show a warning).

@ston1th
Copy link
Contributor Author

ston1th commented Oct 19, 2019

Sounds good. I will test this with monero.

OpenBSD's mmap does not support `MAP_HUGETLB` and `MAP_POPULATE`.
@ston1th
Copy link
Contributor Author

ston1th commented Oct 20, 2019

Compilation and tests of monero are successful.

ston1th added a commit to ston1th/monero that referenced this pull request Oct 20, 2019
Added the `RANDOMX_FLAG_SECURE` for the JIT on OpenBSD.
For a successful build on OpenBSD PR
tevador/RandomX#139 needs to be merged and
imported into the monero tree.

Cleaned up build instructions.
@tevador tevador merged commit a5d1689 into tevador:master Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants