summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-05-03 19:56:50 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-09-16 01:22:20 +0200
commit5bcff4f898497751ddeaad2abd4b474c262614bb (patch)
tree7c99462a47919fa25e246f24602baee95693e3dc
parent31591ce872b9026693715f1d730169f9d18f1e93 (diff)
Handle notification on page eviction
If requested by the user, make libpager call pager_notify_evict when a page is flushed out by the kernel. Based on work by Ognyan Kulev. * console/pager.c (pager_notify_evict): New function. (user_pager_create): Update call to pager_create. * ext2fs/pager.c: (pager_notify_evict): New function. (create_disk_pager): Update call to diskfs_start_disk_pager. (diskfs_get_filemap): Update call to pager_create. * fatfs/pager.c: (pager_notify_evict): New function. (create_fat_pager): Update call to diskfs_start_disk_pager. (diskfs_get_filemap): Update call to pager_create. * isofs/pager.c: (pager_notify_evict): New function. (create_disk_pager): Update call to diskfs_start_disk_pager. (diskfs_get_filemap): Update call to pager_create. * libdiskfs/disk-pager.c (diskfs_start_disk_pager): Update definition and call to pager_create. * libdiskfs/diskfs-pager.h (diskfs_start_disk_pager): Update declaration. * libpager/data-request.c (_pager_seqnos_memory_object_data_request): Take pager's `notify_on_evict' member into account when calling memory_object_data_supply. * libpager/data-return.c (_pager_do_write_request): Handle user notification on page flush. * libpager/pager-create.c (pager_create): Update definition and set pager's `notify_on_evict' member. * libpager/pager.h (pager_create): Update declaration. (pager_notify_evict): New declaration. * libpager/priv.h (struct pager): New `notify_on_evict' member. * storeio/pager.c: (pager_notify_evict): New function. (dev_get_memory_object): Update call to pager_create. * tmpfs/pager-stubs.c (pager_notify_evict): New function. * ufs/pager.c (pager_notify_evict): New function. (create_disk_pager): Update call to diskfs_start_disk_pager. (diskfs_get_filemap): Update call to pager_create.
-rw-r--r--ufs/pager.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ufs/pager.c b/ufs/pager.c
index 1e3d140c..5d3e44ab 100644
--- a/ufs/pager.c
+++ b/ufs/pager.c
@@ -450,6 +450,13 @@ pager_unlock_page (struct user_pager_info *pager,
return err;
}
+void
+pager_notify_evict (struct user_pager_info *pager,
+ vm_offset_t page)
+{
+ assert (!"unrequested notification on eviction");
+}
+
/* Implement the pager_report_extent callback from the pager library. See
<hurd/pager.h> for the interface description. */
inline error_t
@@ -502,7 +509,7 @@ create_disk_pager (void)
upi->type = DISK;
upi->np = 0;
pager_bucket = ports_create_bucket ();
- diskfs_start_disk_pager (upi, pager_bucket, MAY_CACHE, store->size,
+ diskfs_start_disk_pager (upi, pager_bucket, MAY_CACHE, 0, store->size,
&disk_image);
upi->p = diskfs_disk_pager;
}
@@ -595,7 +602,7 @@ diskfs_get_filemap (struct node *np, vm_prot_t prot)
upi->unlocked_pagein_length = 0;
diskfs_nref_light (np);
upi->p = pager_create (upi, pager_bucket,
- MAY_CACHE, MEMORY_OBJECT_COPY_DELAY);
+ MAY_CACHE, MEMORY_OBJECT_COPY_DELAY, 0);
if (upi->p == 0)
{
diskfs_nrele_light (np);