From owner-svn-src-head@freebsd.org Fri May 4 19:21:04 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 C6391FB5A96; Fri, 4 May 2018 19:21:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BADF79257; Fri, 4 May 2018 19:21:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 5FB051F014; Fri, 4 May 2018 19:21:04 +0000 (UTC) (envelope-from jhb@freebsd.org) From: John Baldwin To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333242 - head/sys/kern Date: Fri, 04 May 2018 12:16:42 -0700 Message-ID: <3408582.QRuzgOyxgv@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201805040651.w446p2iB010839@repo.freebsd.org> References: <201805040651.w446p2iB010839@repo.freebsd.org> 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 19:21:04 -0000 On Friday, May 04, 2018 06:51:02 AM Matt Macy wrote: > 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) The log doesn't quite describe what the change is though and why it results in this change. bcopy -> memcpy to permit using the compiler builtin I understand, but using memcpy instead of a structure copy seems rather odd as I would expect the compiler to treat a structure copy as the same as __builtin_memcpy(). > Reported by: mjg@ > MFC after: 1 week > > 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); > } > > -- John Baldwin