diff options
author | Keir Fraser <keir@xen.org> | 2011-01-11 10:38:28 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-01-11 10:38:28 +0000 |
commit | ee3c42ba5bffeb7fa2ea4baac6af8608c707e1b8 (patch) | |
tree | 90e8465e4e7dbf4c5c82282364db8cd6d5e9dc4d /tools/xenpaging | |
parent | bc89270b8a749773ca717a5c21dcce4a9edd7894 (diff) | |
download | xen-ee3c42ba5bffeb7fa2ea4baac6af8608c707e1b8.tar.gz xen-ee3c42ba5bffeb7fa2ea4baac6af8608c707e1b8.tar.bz2 xen-ee3c42ba5bffeb7fa2ea4baac6af8608c707e1b8.zip |
xenpaging: drop paged pages in guest_remove_page
Simply drop paged-pages in guest_remove_page(), and notify xenpaging
to drop its reference to the gfn. If the ring is full, the page will
remain in paged-out state in xenpaging. This is not an issue, it just
means this gfn will not be nominated again.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Diffstat (limited to 'tools/xenpaging')
-rw-r--r-- | tools/xenpaging/xenpaging.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c index 0aed2128b9..cbf75085f6 100644 --- a/tools/xenpaging/xenpaging.c +++ b/tools/xenpaging/xenpaging.c @@ -638,25 +638,34 @@ int main(int argc, char *argv[]) goto out; } - /* Populate the page */ - rc = xenpaging_populate_page(paging, &req.gfn, fd, i); - if ( rc != 0 ) + if ( req.flags & MEM_EVENT_FLAG_DROP_PAGE ) { - ERROR("Error populating page"); - goto out; + DPRINTF("drop_page ^ gfn %"PRIx64" pageslot %d\n", req.gfn, i); + /* Notify policy of page being dropped */ + policy_notify_paged_in(req.gfn); } + else + { + /* Populate the page */ + rc = xenpaging_populate_page(paging, &req.gfn, fd, i); + if ( rc != 0 ) + { + ERROR("Error populating page"); + goto out; + } - /* Prepare the response */ - rsp.gfn = req.gfn; - rsp.p2mt = req.p2mt; - rsp.vcpu_id = req.vcpu_id; - rsp.flags = req.flags; + /* Prepare the response */ + rsp.gfn = req.gfn; + rsp.p2mt = req.p2mt; + rsp.vcpu_id = req.vcpu_id; + rsp.flags = req.flags; - rc = xenpaging_resume_page(paging, &rsp, 1); - if ( rc != 0 ) - { - ERROR("Error resuming page"); - goto out; + rc = xenpaging_resume_page(paging, &rsp, 1); + if ( rc != 0 ) + { + ERROR("Error resuming page"); + goto out; + } } /* Evict a new page to replace the one we just paged in */ |