svn commit: r302924 - stable/10/usr.bin/mkimg

Mark Johnston markj at FreeBSD.org
Sat Jul 16 02:53:53 UTC 2016


Author: markj
Date: Sat Jul 16 02:53:52 2016
New Revision: 302924
URL: https://svnweb.freebsd.org/changeset/base/302924

Log:
  MFC r301090:
  mkimg: Indicate that input file pages are unlikely to be reused.

Modified:
  stable/10/usr.bin/mkimg/image.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/mkimg/image.c
==============================================================================
--- stable/10/usr.bin/mkimg/image.c	Sat Jul 16 02:49:02 2016	(r302923)
+++ stable/10/usr.bin/mkimg/image.c	Sat Jul 16 02:53:52 2016	(r302924)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <assert.h>
+#include <err.h>
 #include <errno.h>
 #include <limits.h>
 #include <paths.h>
@@ -315,6 +316,8 @@ image_file_unmap(void *buffer, size_t sz
 
 	unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz;
 	sz = (sz + unit - 1) & ~(unit - 1);
+	if (madvise(buffer, sz, MADV_DONTNEED) != 0)
+		warn("madvise");
 	munmap(buffer, sz);
 	return (0);
 }


More information about the svn-src-all mailing list