Date: Sun, 30 Jun 2013 13:46:25 +0400 From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: freebsd-arch@freebsd.org Subject: [RFC] Migrate network statistics to PCPU counters Message-ID: <51CFFE71.9080802@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB504481EDEFC3CE9845874F7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi All, A quite time we have in the tree implementation of the percpu counters. The usage of PCPU counters shows better performance and precision, most notably on the machines with many CPUs. I prepared several patches, that moves most of statistics structures in the network stack to the PCPU counters. These patches can be divided to the three parts: 1. Prepare all structures to migration. In most cases this is similar to s/some_type_t/uint64_t/ 2. Add several macros to reduce the code rewriting. 3. Migrate all structures to PCPU counters. Since first part breaks ABI, I want to commit these patches to the head/ before stable/10 will be created. This is the list of structures: ahstat, espstat, ipcompstat, ipipstat, ipsec4stat, ipsec6stat, pfkeystat, mrtstat, pimstat, arpstat, ip6stat, icmp6stat, in6_ifstat, icmp6_ifstat, rip6stat, pim6stat, mrt6stat, udpstat. ipstat and tcpstat already moved to PCPU counters, I just updated implementation. Also there is several structures I didn't touch, e.g. igmpstat, sctpstat. The second part of patches adds several helper macros to sys/counter.h and net/vnet.h. The main idea is that we declare array of counter_u64_t with number of elements equal to number of uint64_t elements in the stats structure and use offsetof() to get access to needed counter. In the same time, the stats structure used as interface with userland. All patches can be found here: http://people.freebsd.org/~ae/stats/ I didn't do any benchmarks yet, for now I just want to discuss implementation and acceptability of these patches. --=20 WBR, Andrey V. Elsukov --------------enigB504481EDEFC3CE9845874F7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBAgAGBQJRz/52AAoJEAHF6gQQyKF6S+sH/3FIsf4kBoGQHXDnweKm4Sev OhvHIGc4OsKuW24NUdPqNORafjCXzPOQc4Hk761c5t6cRBnrFvtM+1ulS0K8gqmD AN1U6XNnwyKDyvmO/8zQBEGCROeSV4Lb6ejmFuIfm9zixPSekOJJmZkbtevxIwal NOAxY5ghK+yOrX3hz/WJqo2t51Dcw1pfGS/CV1MvwRMvw/L5ASMZ6mhv277MezXe AByOB//lZo3SS1R1bHWkv2yhkZNbSuTKplSGeGS9+QYUrU2ioJ9wFKEQCtJFBhUT +67kOm1bTErH4qpXrI65YjbS5fsFna2A5QmXxzQQ6QxnsMUX5kSpk5O/OTLUB9U= =6000 -----END PGP SIGNATURE----- --------------enigB504481EDEFC3CE9845874F7--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51CFFE71.9080802>