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

Haiku support proposal. #218

Merged
merged 2 commits into from
Jun 30, 2020
Merged

Haiku support proposal. #218

merged 2 commits into from
Jun 30, 2020

Conversation

devnexen
Copy link
Collaborator

Basic PAL implementation.
This platform does not support TLS modes.

@mjp41
Copy link
Member

mjp41 commented Jun 28, 2020

@devnexen Could you add an #ifdef __HAIKU__ to fix the Windows build please. Also there is a clangformat issue:

ninja clangformat

should fix that.

Basic PAL implementation.
This platform does not support TLS modes.
@mjp41
Copy link
Member

mjp41 commented Jun 28, 2020

https://git.haiku-os.org/haiku/commit/?id=b94221f3b29c00321e4fe15fcdf499b7275a389c

So the Posix platforms are assuming over commit. Should we set the flag mention in this link?

@mjp41
Copy link
Member

mjp41 commented Jun 29, 2020

@devexen thanks for fixing the issues. My only remaining concerns is how BSS is implemented in Haiku. Does it overcommit bss, or not? On platforms with lazy commit/ overcommit, we load a large flat pagemap in BSS. This is very efficient as it doesn't require any initialisation checking, and also allows for the loader to point the code directly at this map without an indirection. However, it doesn't give much control for how it is loaded.

This could make the snmalloc RSS look 16MiB higher in the default configuration, but we will probably only be using a single page from it. I could add a layer of indirection for certain platforms. I know this would help @nwf for his work with CHERI platforms, where the pagemap has to be much larger.

I think we can take this PR as is which could be used for testing on Haiku, but we should be aware that the RSS numbers can be improved, and any comparison with other allocators on Haiku done before that work should take this into account.

add_compile_options(-fno-exceptions -fno-rtti -g -ftls-model=initial-exec -fomit-frame-pointer)
add_compile_options(-fno-exceptions -fno-rtti -g -fomit-frame-pointer)
if (NOT CMAKE_SYSTEM_NAME MATCHES "Haiku")
add_compile_options(-ftls-model=initial-exec)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please can you leave a comment explaining this? Is there a Haiku TLS ABI doc that you can point at?

Copy link
Collaborator Author

@devnexen devnexen Jun 29, 2020

Choose a reason for hiding this comment

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

Not really but found out a bunch of complains about the same issue I ve faced. Haiku at large is not too well documented, kind of small community driven os project.

0);

if (r != MAP_FAILED)
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't find documentation for the Haiku mmap call. Does it guarantee that the existing mapping is left in place if the map fails?

@mjp41 mjp41 merged commit 4a3102f into microsoft:master Jun 30, 2020
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