summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-09-27 07:54:27 +0000
committerkib <kib@FreeBSD.org>2014-09-27 07:54:27 +0000
commit6a9b8ab035c5cd9b9ca271cea31e96c1309f9316 (patch)
treea613c120b71edff176eb479c22d41696816264d2 /sys/vm
parent48d7d19be1032963ba598acf23049528a50200bc (diff)
downloadFreeBSD-src-6a9b8ab035c5cd9b9ca271cea31e96c1309f9316.zip
FreeBSD-src-6a9b8ab035c5cd9b9ca271cea31e96c1309f9316.tar.gz
MFC r272036:
Avoid calling vm_map_pmap_enter() for the MADV_WILLNEED on the wired entry, the pages must be already mapped. Approved by: re (gjb)
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_map.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 15611bf..a63713d 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2209,7 +2209,14 @@ vm_map_madvise(
vm_object_madvise(current->object.vm_object, pstart,
pend, behav);
- if (behav == MADV_WILLNEED) {
+
+ /*
+ * Pre-populate paging structures in the
+ * WILLNEED case. For wired entries, the
+ * paging structures are already populated.
+ */
+ if (behav == MADV_WILLNEED &&
+ current->wired_count == 0) {
vm_map_pmap_enter(map,
useStart,
current->protection,
OpenPOWER on IntegriCloud