From 9d314501363cae362c9cdb07344eb7380ebd9849 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 26 Mar 1996 21:00:41 +0000 Subject: (_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. --- libpager/data-request.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libpager/data-request.c') 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 -- cgit v1.2.3