From owner-svn-src-head@freebsd.org Fri May 4 14:07:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6EDAFAE7A3; Fri, 4 May 2018 14:07:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31B258343E; Fri, 4 May 2018 14:07:17 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w44E7FhU042499; Fri, 4 May 2018 07:07:15 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w44E7EHg042498; Fri, 4 May 2018 07:07:14 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805041407.w44E7EHg042498@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333242 - head/sys/kern In-Reply-To: <201805040651.w446p2iB010839@repo.freebsd.org> To: Matt Macy Date: Fri, 4 May 2018 07:07:14 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 14:07:19 -0000 > 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