From fdba7ed1e32f4741c019181727ebd3ecd505322b Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Fri, 1 Jul 2005 09:13:54 +0000 Subject: [PATCH] Document move to per-CPU statistics in malloc(9), as well as the use of critical sections instead of mutexes for the per-CPU statistics data, present in 6.0. Prodded by: joel --- en/projects/netperf/index.sgml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/en/projects/netperf/index.sgml b/en/projects/netperf/index.sgml index ac8a8b228f..6f923f46f5 100644 --- a/en/projects/netperf/index.sgml +++ b/en/projects/netperf/index.sgml @@ -1,6 +1,6 @@ - + %includes; @@ -229,6 +229,27 @@ of allocation on SMP is dramatically reduced. + + Modify malloc(9) allocator to use per-CPU statistics with + critical sections to protect malloc_type statistics rather than + global statistics with a mutex. + &a.rwatson; + 20050529 + &status.done; + Previously, malloc(9) used a single statistics structure + protected by a mutex to hold global malloc statistics for each + malloc type. This change moves to per-CPU statistics structures, + which are coalesced when reporting memory allocation statistics to + the user, and protects them using critical sections. This reduces + cache line contention for common allocation types by avoiding + shared lines, and also reduces synchronization costs by using + critical sections to synchronize access instead of a mutex. While + malloc(9) is less frequently used in the network stack than uma(9), + it is used for socket address data, so is on performance critical + paths for datagram operations. This has been committed and will + appear in 6.0-RELEASE. + + Optimize critical section performance &a.jhb;