We are taking a global lock easily. We should not. Talked with Phil, and current plan is introducing per-cpu locking mechanism. Each SmallPage have Mutex*, which could point to per-cpu lock or SmallPage's fine-grained lock. We switch them based on contention and keep deallocation fast without taking a global lock.
This is awesome. I think this will help wasm compile times a lot
Created attachment 399696 [details] Patch WIP
Created attachment 399698 [details] Patch WIP
Created attachment 399717 [details] Patch WIP
Created attachment 399906 [details] Patch WIP
Created attachment 399919 [details] Patch WIP
Created attachment 399920 [details] Patch WIP
Created attachment 399921 [details] Patch WIP
Created attachment 400264 [details] Patch WIP
Created attachment 400814 [details] Patch WIP