Date: Fri, 4 May 2018 07:07:14 -0700 (PDT) From: "Rodney W. Grimes" <freebsd@pdx.rh.CN85.dnsmgr.net> To: Matt Macy <mmacy@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333242 - head/sys/kern Message-ID: <201805041407.w44E7EHg042498@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201805040651.w446p2iB010839@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> Author: mmacy > Date: Fri May 4 06:51:01 2018 > New Revision: 333242 > URL: https://svnweb.freebsd.org/changeset/base/333242 > > Log: > `dup1_processes -t 96 -s 5` on a dual 8160 > > x dup_before > + dup_after > +------------------------------------------------------------+ > | x + | > |x x x x ++ ++| > | |____AM___| |AM|| > +------------------------------------------------------------+ > N Min Max Median Avg Stddev > x 5 1.514954e+08 1.5230351e+08 1.5206157e+08 1.5199371e+08 341205.71 > + 5 1.5494336e+08 1.5519569e+08 1.5511982e+08 1.5508323e+08 96232.829 > Difference at 95.0% confidence > 3.08952e+06 +/- 365604 > 2.03266% +/- 0.245071% > (Student's t, pooled s = 250681) Um, a benchmark result is not a very good commit message, how about something along the lines of: Use memcpy over struct and bcopy to improve performance. > > Reported by: mjg@ > MFC after: 1 week Missing Approved by: sbruno? > Modified: > head/sys/kern/kern_descrip.c > > Modified: head/sys/kern/kern_descrip.c > ============================================================================== > --- head/sys/kern/kern_descrip.c Fri May 4 04:05:07 2018 (r333241) > +++ head/sys/kern/kern_descrip.c Fri May 4 06:51:01 2018 (r333242) > @@ -1503,7 +1503,7 @@ filecaps_copy(const struct filecaps *src, struct filec > > if (src->fc_ioctls != NULL && !locked) > return (false); > - *dst = *src; > + memcpy(dst, src, sizeof(*src)); > if (src->fc_ioctls == NULL) > return (true); > > @@ -1512,7 +1512,7 @@ filecaps_copy(const struct filecaps *src, struct filec > > size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls; > dst->fc_ioctls = malloc(size, M_FILECAPS, M_WAITOK); > - bcopy(src->fc_ioctls, dst->fc_ioctls, size); > + memcpy(dst->fc_ioctls, src->fc_ioctls, size); > return (true); > } > > > -- Rod Grimes rgrimes@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805041407.w44E7EHg042498>