Date: Wed, 22 Aug 2012 16:54:29 +0200 From: Luigi Rizzo <rizzo@iet.unipi.it> To: Mitya <mitya@cabletv.dp.ua> Cc: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: speed tests (Re: Replace bcopy() to update ether_addr) Message-ID: <20120822145429.GB64686@onelab2.iet.unipi.it> In-Reply-To: <5034EC27.1070203@cabletv.dp.ua> References: <20120821112415.GA50078@onelab2.iet.unipi.it> <201208220232.q7M2WLCL020204@ref10-i386.freebsd.org> <20120822143632.GA64686@onelab2.iet.unipi.it> <5034EC27.1070203@cabletv.dp.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 22, 2012 at 05:26:47PM +0300, Mitya wrote: > 22.08.2012 17:36, Luigi Rizzo ??????????????: > >On Wed, Aug 22, 2012 at 02:32:21AM +0000, Bruce Evans wrote: > >>luigi wrote: > >> > >>>even more orthogonal: > >>> > >>>I found that copying 8n + (5, 6 or 7) bytes was much much slower than > >>>copying a multiple of 8 bytes. For n=0, 1,2,4,8 bytes are efficient, > >>>other cases are slow (turned into 2 or 3 different writes). > >>> > >>>The netmap code uses a pkt_copy routine that does exactly this > >>>rounding, gaining some 10-20ns per packet for small sizes. > >>I don't believe 10-20ns for just the extra bytes. memcpy() ends up > >>with a movsb to copy the extra bytes. This can be slow, but I don't > >>believe 10-20ns (except on machines running at i486 speeds of course). > >I am adding at the end a test program so people can try things on their hw. > > > >Build it with > > > > cc -O2 -Werror -Wall -Wextra -lpthread -lrt testlock.c -o testlock > > > > > > # uname -a > FreeBSD m18.cabletv.dp.ua 9.0-STABLE FreeBSD 9.0-STABLE #1: Tue Apr 24 > 13:23:05 EEST 2012 root@m18.cabletv.dp.ua:/usr/src/sys/i386/compile/m18 i386 > > cc -O2 -Werror -Wall -Wextra -lpthread -lrt testlock.c -o testlock > > testlock.c: In function 'test_rdtsc': > testlock.c:151: error: can't find a register in class 'AD_REGS' while > reloading 'asm' > testlock.c:151: error: 'asm' operand has impossible constraints i forgot to mention that i tried this only on amd64, my ASM is horrible. Just comment out the offending lines and do not run those tests. Or, if you have a portable fix, let me know and everybody will appreciate it. cheers luigi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120822145429.GB64686>