summaryrefslogtreecommitdiff
path: root/libpager/data-request.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-03-26 21:00:41 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-03-26 21:00:41 +0000
commit9d314501363cae362c9cdb07344eb7380ebd9849 (patch)
tree2505411c17f870dcb3841fb19bec49a2c1b27575 /libpager/data-request.c
parent94f1f96d40edc17ec9e7beeaab9533b33ec349df (diff)
(_pager_seqnos_memory_object_data_request): Add code to check to see
if there is an existing anticipation that corresponds, and use that in preference to actual pagein. If this page is dirty, then mark the page precious to make sure it gets paged out eventually.
Diffstat (limited to 'libpager/data-request.c')
-rw-r--r--libpager/data-request.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpager/data-request.c b/libpager/data-request.c
index b160ea9c..7f9e55f9 100644
--- a/libpager/data-request.c
+++ b/libpager/data-request.c
@@ -35,6 +35,7 @@ _pager_seqnos_memory_object_data_request (mach_port_t object,
error_t err;
vm_address_t page;
int write_lock;
+ struct anticipation *ant;
p = ports_lookup_port (0, object, _pager_class);
if (!p)
@@ -72,6 +73,16 @@ _pager_seqnos_memory_object_data_request (mach_port_t object,
goto allow_term_out;
}
+ ant = _pager_check_anticipations (p, length, offset);
+ if (ant)
+ {
+ memory_object_data_supply (p->memobjcntl, offset, ant->address,
+ length, 0, VM_PROT_NONE, 0, MACH_PORT_NULL);
+
+ free (ant);
+ goto allow_term_out;
+ }
+
_pager_pagemap_resize (p, offset + length);
/* If someone is paging this out right now, the disk contents are