summaryrefslogtreecommitdiff
path: root/libpager/data-request.c
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
commit0e847864cef404f555387d7fcc97f7dbe769e1e9 (patch)
treedbafbabcd1491b4840914d60358cf153beed9af8 /libpager/data-request.c
parentb2e27fcee4cec98ffc39273ecfaa73aace9da2c3 (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.
Diffstat (limited to 'libpager/data-request.c')
-rw-r--r--libpager/data-request.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpager/data-request.c b/libpager/data-request.c
index 4454facb..34b8b438 100644
--- a/libpager/data-request.c
+++ b/libpager/data-request.c
@@ -119,7 +119,8 @@ _pager_seqnos_memory_object_data_request (mach_port_t object,
goto error_read;
memory_object_data_supply (p->memobjcntl, offset, page, length, 1,
- write_lock ? VM_PROT_WRITE : VM_PROT_NONE, 0,
+ write_lock ? VM_PROT_WRITE : VM_PROT_NONE,
+ p->notify_on_evict ? 1 : 0,
MACH_PORT_NULL);
pthread_mutex_lock (&p->interlock);
_pager_mark_object_error (p, offset, length, 0);