bin/87792: [patch] very bad performance of cp(1) via NFS, possibly mmap() problem

Ted Mittelstaedt tedm at mittelstaedt.us
Mon Oct 29 07:00:03 UTC 2012


The following reply was made to PR bin/87792; it has been noted by GNATS.

From: Ted Mittelstaedt <tedm at mittelstaedt.us>
To: bug-followup at FreeBSD.org, Andre.Albsmeier at 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.
 


More information about the freebsd-bugs mailing list