microsoft / snmalloc

Message passing based allocator
MIT License
1.55k stars 104 forks source link

OpenBSD support #594

Open mjp41 opened 1 year ago

mjp41 commented 1 year ago

We currently have OpenBSD in CI, but the system is failing to initialise the pagemap.

I believe this is because the pagemap is very large, and OpenBSD does not support overcommit. I could not find a MAP_NORESERVE like flag that could be used.

Given the current design, I do not see a way to support an OS that does not separate the concept of reserve and commit, either explicitly as in Windows, or implicitly as in Linux and FreeBSD.

I am raising this issue to track thoughts on this.

@nwf-msr, @davidchisnall, @devnexen

devnexen commented 1 year ago

OpenBSD does not support overcommit nor have any sort of OOM as linux has, instead the memory allocation will just fail.

davidchisnall commented 1 year ago

How did it ever work on OpenBSD? Did it only work on 32-bit systems?

mjp41 commented 1 year ago

Originally, the pagemap was only 16MiB (i.e. in the paper). So at that point it could have worked reasonably. I am thinking we should drop OpenBSD from the CI?

nwf-msr commented 1 year ago

IIRC, snmalloc1 also had a tree-based PageMap option... someone very keen on OpenBSD support could reinstate that? (It should be relatively straightforward as these things go?)