News for hackers. Stuff that matters.
Re:Jemalloc 5.4.0 by loeg on Friday September 18, 2026 @03:33PM (#49759093)
Don't you just take the current cpuid when you go to access the cache again? Then you mutex and access the per-cpu state. There is a tiny race window but 99.99% of the time you will be hitting the same cpu's cache as you just identified, and there will be ~zero contention.

The main issue is thread preemption while you're holding a per-core cache mutex. Some other thread can't do meaningful work using the cache while the holder is sleeping.

Re:Jemalloc 5.4.0 by ckennelly on Friday September 18, 2026 @08:36PM (#49762138)
With restartable sequences in Linux, there is no need for mutexes or RMW atomics. The mutual exclusion is guaranteed by the kernel.
Re:Jemalloc 5.4.0 by loeg on Saturday September 19, 2026 @12:35AM (#49763337)
Fair enough.