allocate: thread-local allocations.#212
Conversation
|
Due to cross-cpu migration I don't think this is SMP-safe at the moment. Each cpu has it's own tlab bump/limit, but there's no synchronization here ensuring the correct limit is compared against if a migration occurs between the limit load and bump update.
Same issue on arm64. Possible solutions:
Aside from this, I really like the approach. It's surprisingly non-invasive |
|
arm64 build completes successfully with my changes btw |
|
TSX would've fixed this. Anyway, I think option 1 is better. Since Claimore would be thread-local... |
|
changes look good, but we still have cpu-local accounting (bytes-consed, cons-allocation-count, cons-fast-path-hits, general-allocation-count, general-fast-path-hits), are they worth keeping/do they have the same race condition as allocation did? |
|
technically there's a race but on x86 they should add up to the same number with a tiny skew, while ARM would lose counts. However there is no real data corruption. Whether to keep those counters is up to you. |
|
i.e x86 could have 7+3 allocs instead of 6+4 |
|
I don't think the GC relies on these counters, so happy to merge this. Maybe we can revisit accuracy at a later time |
No description provided.