cvs commit: src/lib/libc/stdlib malloc.c
Jason Evans
jasone at FreeBSD.org
Mon Nov 26 19:17:30 PST 2007
jasone 2007-11-27 03:17:30 UTC
FreeBSD src repository
Modified files:
lib/libc/stdlib malloc.c
Log:
Implement dynamic load balancing of thread-->arena mapping, based on lock
contention. The intent is to dynamically adjust to load imbalances, which
can cause severe contention.
Use pthread mutexes where possible instead of libc "spinlocks" (they aren't
actually spin locks). Conceptually, this change is meant only to support
the dynamic load balancing code by enabling the use of spin locks, but it
has the added apparent benefit of substantially improving performance due to
reduced context switches when there is moderate arena lock contention.
Proper tuning parameter configuration for this change is a finicky business,
and it is very much machine-dependent. One seemingly promising solution
would be to run a tuning program during operating system installation that
computes appropriate settings for load balancing. (The pthreads adaptive
spin locks should probably be similarly tuned.)
Revision Changes Path
1.151 +297 -58 src/lib/libc/stdlib/malloc.c
More information about the cvs-src
mailing list