Summary: | [patch] very bad performance of cp(1) via NFS, possibly mmap() problem | ||
---|---|---|---|
Product: | Base System | Reporter: | Andre.Albsmeier |
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Open --- | ||
Severity: | Affects Only Me | Keywords: | patch |
Priority: | Normal | ||
Version: | 5.4-STABLE | ||
Hardware: | Any | ||
OS: | Any |
Description
Andre.Albsmeier
2005-10-21 17:40:15 UTC
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. I even went a step further an simply Undef'ed VM_AND_BUFFER_CACHE_SYNCHRONIZED in cp's Makefile so the entire mmap code gets disabled... For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi> |