Date: Sun, 21 Jan 2007 14:00:19 -0800 From: Luigi Rizzo <rizzo@icir.org> To: Ivan Voras <ivoras@fer.hr> Cc: freebsd-arch@freebsd.org Subject: Re: bzero & bcopy alignment Message-ID: <20070121140019.A83688@xorpc.icir.org> In-Reply-To: <ep0mlv$194$1@sea.gmane.org>; from ivoras@fer.hr on Sun, Jan 21, 2007 at 10:41:09PM %2B0100 References: <ep0mlv$194$1@sea.gmane.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 21, 2007 at 10:41:09PM +0100, Ivan Voras wrote: > Following recent discussion on alignment of bzero() and bcopy(), I've > added some statistics collecting code to bzero() and bcopy() for > practice (on a RELENG_6 box), and here are the cumulative results for > argument alignment: i think these profiles depend heavily on the hardware and usage patterns. e.g. some network drivers force you to aligned buffers which results in misaligned payload requesting in turn an unaligned bcopy. Not that one can help with this, but i think that is also important to locate the locations in the source where the poorly aligned (1-2, maybe 4 and 8 to some degree) ops occur. cheers luigi > 128: 117190 > 64: 46495 > 32: 745178 > 16: 35313 > 8: 64580 > 4: 131045 > 2: 17969 > 1: 25099 > > This is somewhat early after bootup. First number is the alignment, > second argument is the number of calls that passed a pointer having the > alignment (e.g. there were 131045 instances of arguments which had data > aligned to 4 bytes in either bcopy or bzero). After some compiling > (start of a buildkernel), the data is: > > 128: 341440 > 64: 66812 > 32: 1020807 > 16: 75574 > 8: 192189 > 4: 266904 > 2: 44975 > 1: 36411 > > If the data is correct, most data seem to be aligned fairly ok. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070121140019.A83688>