Date: Tue, 4 Nov 2014 13:41:41 +0000 From: Andrew Turner <andrew@fubar.geek.nz> To: Mateusz Guzik <mjguzik@gmail.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky <hselasky@FreeBSD.org> Subject: Re: svn commit: r274088 - head/sys/kern Message-ID: <20141104134141.22d88841@bender.lan> In-Reply-To: <20141104114041.GA21297@dft-labs.eu> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> <20141104114041.GA21297@dft-labs.eu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 4 Nov 2014 12:40:41 +0100 Mateusz Guzik <mjguzik@gmail.com> wrote: > On Tue, Nov 04, 2014 at 11:29:49AM +0000, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Tue Nov 4 11:29:49 2014 > > New Revision: 274088 > > URL: https://svnweb.freebsd.org/changeset/base/274088 > > > > Log: > > Simplify logic a bit. Ensure data buffer is properly aligned, > > especially for platforms where unaligned access is not allowed. > > Make it possible to override the small buffer size. > > > > A simple continuous read string test using libusb showed a > > reduction in CPU usage from roughly 10% to less than 1% using a > > dual-core GHz CPU, when the malloc() operation was skipped for > > small buffers. > > MFC after: 2 weeks > > > > Modified: > > head/sys/kern/sys_generic.c > > > > Modified: head/sys/kern/sys_generic.c > > ============================================================================== > > --- head/sys/kern/sys_generic.c Tue Nov 4 10:25:52 > > 2014 (r274087) +++ head/sys/kern/sys_generic.c Tue > > Nov 4 11:29:49 2014 (r274088) @@ -646,10 +646,13 @@ struct > > ioctl_args { int > > sys_ioctl(struct thread *td, struct ioctl_args *uap) > > { > > +#ifndef SYS_IOCTL_SMALL_SIZE > > +#define SYS_IOCTL_SMALL_SIZE 128 > > +#endif > > + u_char smalldata[SYS_IOCTL_SMALL_SIZE] __aligned(8); > > Should not you align to word size instead? On ARM it needs to be at least 8-byte aligned as this is the largest alignment of any types. Andrew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141104134141.22d88841>