cc7f01a5da
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 |
||
---|---|---|
.. | ||
tests | ||
apm.c | ||
bsd.c | ||
ebr.c | ||
format.c | ||
format.h | ||
gpt.c | ||
image.c | ||
image.h | ||
Makefile | ||
Makefile.depend | ||
mbr.c | ||
mkimg.1 | ||
mkimg.c | ||
mkimg.h | ||
pc98.c | ||
qcow.c | ||
raw.c | ||
scheme.c | ||
scheme.h | ||
vhd.c | ||
vmdk.c | ||
vtoc8.c |