ebe0d361 | 11-Oct-2010 |
Matthew Dillon <dillon@apollo.backplane.com> |
nmalloc - Fix depot race - this should fix remaining issues with firefox.
* nmalloc was accidently calling the libc _pthread_spin_lock() stub even when threaded, causing all depot operations to ra
nmalloc - Fix depot race - this should fix remaining issues with firefox.
* nmalloc was accidently calling the libc _pthread_spin_lock() stub even when threaded, causing all depot operations to race. No actual lock was being acquired.
Change it over to the internal _SPINLOCK() API.
* Expand libthread_xu's base spinlocks from 128 to 256 and use those for the depot lock. Note that the depot[] array can be upwards of 80 elements so lets not take any chances.
Reported-by: Pierre Abbat <phma@phma.optus.nu>, others
show more ...
|
e58e48b4 | 09-Oct-2010 |
Matthew Dillon <dillon@apollo.backplane.com> |
libc - Do some reorganization of nmalloc() and add asserts.
* Reorganize mtmagazine_alloc() and mtmagazine_free() to make the code more clear. Add assertions on 'continue' loops so we abort on
libc - Do some reorganization of nmalloc() and add asserts.
* Reorganize mtmagazine_alloc() and mtmagazine_free() to make the code more clear. Add assertions on 'continue' loops so we abort on magazine memory corruption instead of looping forever.
* Pre-stage the new magazine that mtmagazine_free() might need to avoid having to relock the depot. This also allows us to stage the new magazine directory into the per-thread loaded field instead of running it through the depot.
* Fix a deep or infinite recursion which can occur when mtmagazine_free() calls _slaballoc(), which it does sometimes when it needs a new magazine. Avoid reentrancy by temporarily disabling the per-thread cache around the call.
show more ...
|