Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jul 2016 02:53:52 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r302924 - stable/10/usr.bin/mkimg
Message-ID:  <201607160253.u6G2rq6x055642@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607160253.u6G2rq6x055642>