From Andre.Albsmeier@siemens.com  Tue Apr 16 17:03:10 2013
Return-Path: <Andre.Albsmeier@siemens.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 889842AF
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Apr 2013 17:03:10 +0000 (UTC)
	(envelope-from Andre.Albsmeier@siemens.com)
Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28])
	by mx1.freebsd.org (Postfix) with ESMTP id 0B2FF929
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Apr 2013 17:03:09 +0000 (UTC)
Received: from mail3.siemens.de (localhost [127.0.0.1])
	by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id r3GGoKK8013001
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Apr 2013 18:50:20 +0200
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130])
	by mail3.siemens.de (8.13.6/8.13.6) with ESMTP id r3GGoJ6D029171
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Apr 2013 18:50:19 +0200
Received: (from localhost)
	by curry.mchp.siemens.de (8.14.6/8.14.6) id r3GGoJ1X019927
	for FreeBSD-gnats-submit@freebsd.org; Tue, 16 Apr 2013 18:50:19 +0200 (CEST)
Message-Id: <201304161650.r3GGoJtS009110@curry.mchp.siemens.de>
Date: Tue, 16 Apr 2013 18:50:19 +0200 (CEST)
From: Andre Albsmeier <Andre.Albsmeier@siemens.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: regression on cp performance
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         177885
>Category:       bin
>Synopsis:       [patch] cp(1): regression on cp performance
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 16 17:10:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Tue Apr 16 19:16:12 UTC 2013
>Originator:     Andre Albsmeier
>Release:        FreeBSD 9.1-STABLE i386
>Organization:
>Environment:

System: FreeBSD 9.1-STABLE #0: Sun Apr 7 11:10:42 CEST 2013

>Description:

When copying large files (300MB here) with cp from the local
machine to a NFS mounted drive, the performance is bad:

user@host:>time cp file /mnt/
cp file /mnt/  0,00s user 1,50s system 5% cpu 25,246 total

When reverting the effects of r184342 of bin/cp/utils.c by
the patch shown below, performance is back again:

user@host:>time cp file /mnt/
cp file /mnt/  0,00s user 0,43s system 7% cpu 5,732 total

Verified on several hosts, all running FreeBSD 9.1-STABLE,
all using UFS (not ZFS).

FreeBSD 7.4 does not show this bug since r184342 wasn't
merged here.

>How-To-Repeat:

See above.

>Fix:

Revert r184342 or use this patch:

--- bin/cp/utils.c.ORI  2012-09-24 18:09:20.000000000 +0200
+++ bin/cp/utils.c      2013-04-16 18:47:12.000000000 +0200
@@ -68,6 +68,9 @@
  * smaller than MAXPHYS */
 #define BUFSIZE_SMALL (MAXPHYS)
 
+#undef BUFSIZE_MAX
+#define BUFSIZE_MAX (MAXPHYS)
+
 int
 copy_file(const FTSENT *entp, int dne)
 {
>Release-Note:
>Audit-Trail:
>Unformatted:
