Date: Sun, 30 Jun 2013 20:53:57 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: "Andrey V. Elsukov" <ae@FreeBSD.org> Cc: freebsd-arch@freebsd.org Subject: Re: [RFC] Migrate network statistics to PCPU counters Message-ID: <20130630175357.GJ91021@kib.kiev.ua> In-Reply-To: <51CFFE71.9080802@FreeBSD.org> References: <51CFFE71.9080802@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--8vsJbyf2sKRbOxj1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 30, 2013 at 01:46:25PM +0400, Andrey V. Elsukov wrote: > Hi All, >=20 > 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. >=20 > 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: >=20 > 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. >=20 > 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: >=20 > ahstat, espstat, ipcompstat, ipipstat, ipsec4stat, ipsec6stat, > pfkeystat, mrtstat, pimstat, arpstat, ip6stat, icmp6stat, in6_ifstat, > icmp6_ifstat, rip6stat, pim6stat, mrt6stat, udpstat. >=20 > 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. >=20 > 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. Only reacting to the last sentence. I think this is notoriously bad, the in-kernel interfaces and usermode ABI should be split. The reuse of the structures for kernel and for interfacing to usermode is the reason why we cannot ensure the stability of the management ABI even on stable. I suggest to not doing this, instead having the dedicated definitions for user mode, and also to add padding to the usermode interface for future extensions. >=20 > All patches can be found here: >=20 > http://people.freebsd.org/~ae/stats/ >=20 > I didn't do any benchmarks yet, for now I just want to discuss > implementation and acceptability of these patches. >=20 > --=20 > WBR, Andrey V. Elsukov >=20 --8vsJbyf2sKRbOxj1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR0HC0AAoJEJDCuSvBvK1BjCoP/jcrZLSk6krGkjKxZq8+3oZV tdCK6L4IIDfCY7f7PnNI6+2hbgCGRX9hulKILgDXCqN2sPv0Wgk/zI1dOuPhQ6ei LkAG9Mc7kcdmvq8rs7iSgDPZO5NmQHPwAzx3fxGOQHu9xg5IGhAg/UsbnlGPkXcM sUJlV26++mWQX4V+qtxxuYWmkVuTsYSuPQpuOrKvIPAfCBnjphY/dXpYGA/7rAfs uiqhfBHJ2+Zf3m/ajgewa+iWjzIOfMCwQeqCPkkll/tj2il8NdnwX0wY5omSNxy3 qEJ6TGLluP5i7jhq/atEQaMxX+08ZY3mTRYbjg942P+iqi+Z9WivB8xyUQMKofLV waNIwZDqrk9Z/QAEfb2mIwRhoyeFVuQY2gDwrvHacIW5dRzwwGTjKGFthYKoGRQI +2f3jARq/FYyAkNSzl1N+w4AFTXZjIoKGKBLK0+b5x46gviVsTOH/PBPdDfLdK03 R/+7l90KdoUnJxw7vf3o8UeZNAD7abbvG1ck1pAlb0djKFA8tSK5iMLrxMMO7be0 xQazPxgtS37C30125/W5RqNftOuWKEVqGlZoNiSimSV4HjC1DtocUTvf3WaxJIg7 /TKXtbKYP0qPZcvADhrFDjLi0exqbqDl2nzcJJeARmZEPKdr96jKw8KnZI/XZsnk 9sSaOwYIcVEoIksqg3LA =SotU -----END PGP SIGNATURE----- --8vsJbyf2sKRbOxj1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130630175357.GJ91021>
