aboutsummaryrefslogtreecommitdiff
path: root/vm/vm_object.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-06-17 12:50:45 +0200
committerRichard Braun <rbraun@sceen.net>2016-06-17 12:58:33 +0200
commit8fcdfb646d145f285341ef597568bb9e003ce28f (patch)
treed2b8ff63f7c0403c329362e4352505b4f2b8b5e1 /vm/vm_object.c
parentfdf86cccfeb4c3e09e024b3a35bbce6308f36412 (diff)
downloadgnumach-8fcdfb646d145f285341ef597568bb9e003ce28f.tar.gz
gnumach-8fcdfb646d145f285341ef597568bb9e003ce28f.tar.bz2
gnumach-8fcdfb646d145f285341ef597568bb9e003ce28f.zip
Change page cache statistics
Instead of reporting statistics about unreferenced objects (the object cache), report statistics about external objects (the page cache). * vm/vm_object.c (vm_object_cached_count): Remove variable. (vm_object_cache_add): Remove object cache stats updates. (vm_object_cache_remove): Likewise. (vm_object_terminate): Update page cache stats. * vm/vm_object.h (vm_object_cached_count): Remove variable. (vm_object_cached_pages): Likewise. (vm_object_cached_pages_lock_data): Likewise. (vm_object_cached_pages_update): Remove macro. (vm_object_external_count): New extern variable. (vm_object_external_pages): Likewise. * vm/vm_resident.c (vm_object_external_count): New variable. (vm_object_external_pages): Likewise. (vm_page_insert): Remove object cache stats updates and update page cache stats. (vm_page_replace): Likewise. (vm_page_remove): Likewise. * vm/vm_user.c (vm_cache_statistics): Report page cache stats instead of object cache stats.
Diffstat (limited to 'vm/vm_object.c')
-rw-r--r--vm/vm_object.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/vm/vm_object.c b/vm/vm_object.c
index 046b6c49..1e80bbca 100644
--- a/vm/vm_object.c
+++ b/vm/vm_object.c
@@ -181,7 +181,6 @@ vm_object_t kernel_object = &kernel_object_store;
* not be held to make simple references.
*/
queue_head_t vm_object_cached_list;
-int vm_object_cached_count;
decl_simple_lock_data(,vm_object_cached_lock_data)
@@ -362,8 +361,6 @@ static void vm_object_cache_add(
{
assert(!object->cached);
queue_enter(&vm_object_cached_list, object, vm_object_t, cached_list);
- vm_object_cached_count++;
- vm_object_cached_pages_update(object->resident_page_count);
object->cached = TRUE;
}
@@ -372,8 +369,6 @@ static void vm_object_cache_remove(
{
assert(object->cached);
queue_remove(&vm_object_cached_list, object, vm_object_t, cached_list);
- vm_object_cached_count--;
- vm_object_cached_pages_update(-object->resident_page_count);
object->cached = FALSE;
}
@@ -621,6 +616,14 @@ void vm_object_terminate(
assert(object->paging_in_progress == 0);
assert(!object->cached);
+ if (!object->internal) {
+ assert(object->resident_page_count == 0);
+
+ vm_page_lock_queues();
+ vm_object_external_count--;
+ vm_page_unlock_queues();
+ }
+
/*
* Throw away port rights... note that they may
* already have been thrown away (by vm_object_destroy
@@ -2091,6 +2094,9 @@ restart:
object->internal = FALSE;
object->temporary = FALSE;
+ assert(object->resident_page_count == 0);
+ vm_object_external_count++;
+
/* user pager objects are not ready until marked so */
object->pager_ready = FALSE;