Page MenuHomeFreeBSD

Remove PAGE_SIZE from libthr
ClosedPublic

Authored by andrew on Apr 20 2022, 4:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 10:21 PM
Unknown Object (File)
Mar 9 2024, 1:30 AM
Unknown Object (File)
Mar 9 2024, 1:30 AM
Unknown Object (File)
Mar 8 2024, 8:24 AM
Unknown Object (File)
Feb 5 2024, 5:16 PM
Unknown Object (File)
Jan 6 2024, 5:25 AM
Unknown Object (File)
Jan 6 2024, 1:45 AM
Unknown Object (File)
Jan 4 2024, 6:50 AM
Subscribers

Details

Summary

In libthr we use PAGE_SIZE when allocating memory with mmap and to check
various structs will fit into a single page so we can use this allocator
for them.

Ask the kernel for the page size on init for use by the page allcator
and add a new machine dependent macro to hold the smallest page size
the architecture supports to check the structure is small enough.

This allows us to use the same libthr on arm64 with either 4k or 16k
pages.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Apr 20 2022, 8:13 PM
kib added inline comments.
lib/libthr/thread/thr_barrier.c
40

I think this change is not strictly needed, since off-page is really a page size.

I must admit that arm64 with PAGE_SIZE != 4k is really a different arch, it should not be called arm64.

This revision was automatically updated to reflect the committed changes.