-
Notifications
You must be signed in to change notification settings - Fork 74
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
Should we avoid using fat pointers for SFT? #945
Comments
As we use
For x86_64 and aarch64, we should be fine. On platforms that use fallback implementation, we will have a performance issue. |
I confirmed using cross-compilation toolchain that on aarch64-unknown-linux-gnu, On riscv64gc-unknown-linux-gnu, AtomicU128 is not lock-free. |
I think there are many possibilities. For the generous heap layout where each space occupies a dedicated 2TB region, we can eagerly populate the SFTSpaceMap. From then on, we only need read-only access for SFT entries. For SFTDenseChunkMap, only the first level map (from chunk address to space index) needs to be atomic. The second level is a map from space index to For SFTSparseChunkMap, each chunk maps directly to a |
Cross compiling without You are right that we probably can refactor and do not really need atomic access to SFT for |
We currently store SFT entries as
&dyn SFT
which is a fat pointers. This is only efficient when the platform supports atomic instructions for double word size, i.e. 128 bits atomics on 64bits machines, and 64 bits atomics on 32 bits machines. We will give a warning in a debug build if the platform does not support double word atomics, in which case, a fall back locking mechanism is used to ensure the atomic access.If we would like to provide efficient implementation for platforms that do not support 128 bits atomics, we should consider not using
&dyn SFT
. We need a way to represent an SFT entry as a normal pointer.The text was updated successfully, but these errors were encountered: