freebsd-dev/usr.bin
Mark Johnston cc7f01a5da mkimg: Indicate that input file pages are unlikely to be reused.
mkimg(1) uses a swap file to back input file chunks. When the output file
is being written out, blocks of the swap file are mapped and their contents
copied. This causes the backing VM pages to enter the active queue, and when
the output file is large relative to system memory (as is generally the
case), can result in a shortfall of inactive memory. This causes the
pagedaemon to aggressively scan the active queue and swap out process
memory in an attempt to meet the shortfall. Because mkimg's input files
are typically the intermediate result of some build process, there's no
need to push them all through the active queue. Use madvise(2) to indicate
that the backing pages may be reclaimed in preference to active pages. In
the case of the swap file, these pages will be freed as soon as mkimg
exits anyway.

When using mkimg on a desktop-class system with large amounts of dirty
process memory, this change substantially improves mkimg runtime and
reduces swap usage.

Reviewed by:	marcel
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D6654
2016-06-01 02:30:06 +00:00
..
addr2line elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree 2016-04-21 12:58:29 +00:00
alias
apply Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
ar Make code compile when basename() is POSIX compliant. 2016-05-26 13:49:40 +00:00
asa
at Fix typo: actually test the return of strchr(3) 2016-04-20 20:54:47 +00:00
atm
awk DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools. 2016-05-09 22:21:09 +00:00
banner
basename Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
bc
biff
bluetooth
bmake Merge bmake-20160512 2016-05-20 17:35:39 +00:00
brandelf
bsdcat MFV r299425: 2016-05-12 10:16:16 +00:00
bsdiff Cleanup unnecessary semicolons from utilities we all love. 2016-04-15 22:31:22 +00:00
bzip2
bzip2recover
c89
c99
caesar
calendar Add myself (woodsb02) to the calendar.freebsd file 2016-05-09 20:21:49 +00:00
cap_mkdb
catman Instead of ignoring the EEXIST from link(), unconditionally unlink 2016-05-13 05:49:02 +00:00
chat Fix off by one error that overflowed the rep_len array when doing 2016-05-16 19:48:02 +00:00
checknr
chkey
chpass
cksum
clang MFH 2016-03-10 21:16:01 +00:00
cmp Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
col Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
colcrt
colldef Note that mklocale(1) and colldef(1) are no longer used 2016-04-17 23:02:49 +00:00
colrm
column
comm Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
compile_et
compress
cpio MFV r299425: 2016-05-12 10:16:16 +00:00
cpuset
csplit Rename getline with get_line to avoid collision with getline(3) 2016-05-10 11:11:23 +00:00
ctags Rename getline with get_line to avoid collision with getline(3) 2016-05-10 11:11:23 +00:00
ctlstat
cut Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
cxxfilt elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree 2016-04-21 12:58:29 +00:00
dc
dirname Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
dpv
drill
dtc
du
ee
elf2aout
elfcopy elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree 2016-04-21 12:58:29 +00:00
elfdump
enigma
env
expand
factor
false
fetch Add phttpget(8) .Xr to fetch(1). 2016-03-29 11:56:00 +00:00
file
file2c Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
find Use NULL instead of 0 for pointers. 2016-04-18 07:05:18 +00:00
finger Use NULL instead of 0 for pointers. 2016-04-18 14:44:01 +00:00
fmt fmt(1): for pointers use NULL instead of 0 2016-04-13 01:57:06 +00:00
fold
fortune Avoid buffer overflow when copying the input file name and appending .dat. 2016-05-26 01:33:24 +00:00
from
fstat
fsync
ftp
gcore Fix buffer overrun in gcore(1) NT_PRPSINFO 2016-05-11 15:31:31 +00:00
gencat Rename getline with get_line to avoid collision with getline(3) 2016-05-10 11:12:31 +00:00
getconf
getent
getopt
gprof Use NULL instead of 0 for pointers. 2016-05-16 01:11:02 +00:00
grdc
grep Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
gzip Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
head
hesinfo
hexdump
host
iconv
id
ident Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
indent
ipcrm
ipcs
iscsictl Add "iscsictl -e". Among other things, it makes it possible to perform 2016-05-31 11:32:07 +00:00
join Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
jot Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
kdump Fix humanized decoding of struct stat with respect to .st_mtim 2016-05-22 18:20:45 +00:00
keylogin
keylogout
killall
ktrace Add a cross reference to ktrace(2). 2016-03-31 23:57:03 +00:00
ktrdump
lam
last
lastcomm Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
ldd Increase size of argv[] array to avoid running off the end. 2016-05-16 16:01:46 +00:00
leave
less
lessecho
lesskey
lex Use NULL instead of 0 for pointers. 2016-04-19 02:05:32 +00:00
limits Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
locale Use the nitems() macro 2016-04-17 22:42:48 +00:00
localedef localedef(1): minor spelling fixes on comments. 2016-05-01 16:10:56 +00:00
locate
lock
lockf
logger
login Use NULL instead of 0. 2016-04-18 05:26:32 +00:00
logins
logname
look
lorder
lsvfs
lzmainfo
m4 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
mail Always return either a dynamically allocated string or NULL from 2016-05-13 06:15:05 +00:00
makewhatis
man
mandoc
mesg
minigzip
ministat
mkcsmapper
mkcsmapper_static META_MODE: Don't rebuild build-tools targets during normal build. 2016-04-14 21:06:10 +00:00
mkdep
mkesdb
mkesdb_static META_MODE: Don't rebuild build-tools targets during normal build. 2016-04-14 21:06:10 +00:00
mkfifo
mkimg mkimg: Indicate that input file pages are unlikely to be reused. 2016-06-01 02:30:06 +00:00
mklocale Use strlcpy() instead of strncpy() when copying the encoding value 2016-05-12 08:41:22 +00:00
mkstr
mktemp
mkuzip DIRDEPS_BUILD: Update dependencies. 2016-05-04 03:14:34 +00:00
morse
msgs Use strlcpy() instead of strncpy() when copying date and subj 2016-05-12 08:55:57 +00:00
mt Add the density code for LTO-7 to libmt and the mt(1) man page. 2016-05-20 19:30:52 +00:00
nc
ncal swprintf() and apparently wcsftime() want the their output buffer size 2016-05-17 05:05:30 +00:00
netstat Use macro MAX() from sys/param.h. 2016-04-22 03:37:27 +00:00
newgrp Remove useless calls to basename(). 2016-05-01 08:22:11 +00:00
newkey
nfsstat
nice
nl
nm elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree 2016-04-21 12:58:29 +00:00
nohup
numactl Don't repeat the the word 'the' 2016-05-17 12:52:31 +00:00
number
opieinfo
opiekey
opiepasswd
pagesize
pamtest
passwd
paste
patch Adjust a type from r267490. 2016-04-24 04:28:04 +00:00
pathchk
perror
pom
pr
primes
printenv
printf Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
procstat
protect
quota Use MIN() macro from sys/param.h. 2016-04-27 02:13:57 +00:00
random random(6): Fix double-close 2016-05-11 22:04:28 +00:00
rctl Add four new RCTL resources - readbps, readiops, writebps and writeiops, 2016-04-07 04:23:25 +00:00
readelf elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree 2016-04-21 12:58:29 +00:00
renice
resizewin Fix a mandoc -Tlint warning 2016-04-16 12:49:26 +00:00
rev
revoke
rlogin
rpcgen rpcgen(1): Tag crash() routine as __dead2 for static analyzers 2016-05-12 03:49:05 +00:00
rpcinfo Simplify some overly complex code so that both humans and Coverity 2016-05-13 00:50:53 +00:00
rs Rename getline with get_line to avoid collision with getline(3) 2016-05-10 11:17:36 +00:00
rsh
rup
ruptime
rusers
rwall
rwho
script Directly set the O_CLOEXEC flags via the open(2) attributes 2016-04-16 12:47:23 +00:00
sdiff sdiff(1): Fix potential NULL deref in cleanup path 2016-05-10 20:09:40 +00:00
sed sed: convert sed to use REG_STARTEND more explicitly. 2016-05-25 15:42:39 +00:00
send-pr
seq
setchannel
shar
showmount Cleanup unnecessary semicolons from utilities we all love. 2016-04-15 22:31:22 +00:00
size elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree 2016-04-21 12:58:29 +00:00
smbutil
sockstat
soelim Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
sort Cleanup unnecessary semicolons from utilities we all love. 2016-04-15 22:31:22 +00:00
split
ssh-copy-id
stat Use MIN() instead of MAX() as the previous syntax was wrote in a weird and 2016-04-26 00:29:00 +00:00
stdbuf
strings elftoolchain: Use ${SRCTOP} for the top of the FreeBSD tree 2016-04-21 12:58:29 +00:00
su
svn Update from subversion 1.9.2 to 1.9.4. 2016-04-30 10:35:42 +00:00
systat Use macro MIN() from sys/param.h. 2016-04-27 02:26:31 +00:00
tabs
tail
talk User NULL instead of 0 for pointers. 2016-04-18 07:14:01 +00:00
tar MFV r299425: 2016-05-12 10:16:16 +00:00
tcopy
tee
telnet
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
tftp Use MIN() macro from sys/param.h. 2016-04-27 02:34:25 +00:00
time
timeout Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
tip
top Use MIN() macro from sys/param.h. 2016-04-27 02:44:10 +00:00
touch
tput
tr Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
true
truncate Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
truss Cleanup unnecessary semicolons from utilities we all love. 2016-04-15 22:31:22 +00:00
tset
tsort
tty
ul Rationalize license numbering 2016-05-09 20:55:35 +00:00
uname
unexpand
unifdef
uniq
units Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
unvis
unzip
usbhidaction
usbhidctl
users
uudecode Rename getline with get_line to avoid collision with getline(3) 2016-05-10 11:12:31 +00:00
uuencode Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
vacation
vgrind
vi DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools. 2016-05-09 22:21:09 +00:00
vis
vmstat Use MIN() macro from sys/param.h. 2016-04-22 03:46:57 +00:00
vtfontcvt vtfontcvt: support .hex fonts with characters beyond the Unicode BMP 2016-03-15 21:32:46 +00:00
w
wall
wc
what
whereis usr.bin: minor spelling fixes on comments. 2016-05-01 16:13:05 +00:00
which
who
whois Send whois queries for gov.uk names to JANET. 2016-05-25 13:09:06 +00:00
write
xargs Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
xinstall install: Revert utimensat usage (r299850). 2016-05-16 12:56:28 +00:00
xlint Fix with external GCC after r300886. 2016-05-29 01:15:15 +00:00
xo Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
xstr Cleanup unnecessary semicolons from utilities we all love. 2016-04-15 22:31:22 +00:00
xz
xzdec
yacc Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
yes
ypcat
ypmatch
ypwhich
Makefile MFV r299425: 2016-05-12 10:16:16 +00:00
Makefile.amd64
Makefile.arm
Makefile.i386
Makefile.inc
Makefile.powerpc
Makefile.sparc64