From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 29 07:00:03 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C870D12 for ; Mon, 29 Oct 2012 07:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 4F97D8FC0C for ; Mon, 29 Oct 2012 07:00:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9T703F2083506 for ; Mon, 29 Oct 2012 07:00:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9T703Tu083505; Mon, 29 Oct 2012 07:00:03 GMT (envelope-from gnats) Date: Mon, 29 Oct 2012 07:00:03 GMT Message-Id: <201210290700.q9T703Tu083505@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ted Mittelstaedt Subject: Re: bin/87792: [patch] very bad performance of cp(1) via NFS, possibly mmap() problem X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Ted Mittelstaedt List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 07:00:03 -0000 The following reply was made to PR bin/87792; it has been noted by GNATS. From: Ted Mittelstaedt To: bug-followup@FreeBSD.org, Andre.Albsmeier@siemens.com Cc: Subject: Re: bin/87792: [patch] very bad performance of cp(1) via NFS, possibly mmap() problem Date: Sun, 28 Oct 2012 23:53:01 -0700 Try the following: In bin/cp/utils.c (source) there is a check, if the file is less than 8MB or so, it uses mmap, if the file is larger, it will use write() Modify the source and recompiled to -never- use mmap, only to use write() Change line 143: original: fs->st_size <= 8 * 1048576) { New: fs->st_size <= 8 * 8) { It will use mmap still if the file is larger than 64bytes (if it uses bytes there, pretty sure it does). This is from a response to the freebsd-stable mailing list back in 2009 by Brent Jones he reported a 100 fold increase.