From 8fcdfb646d145f285341ef597568bb9e003ce28f Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Fri, 17 Jun 2016 12:50:45 +0200 Subject: 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. --- vm/vm_object.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'vm/vm_object.h') diff --git a/vm/vm_object.h b/vm/vm_object.h index e1dd0ba1..1914e8ee 100644 --- a/vm/vm_object.h +++ b/vm/vm_object.h @@ -394,20 +394,9 @@ MACRO_END /* * Page cache accounting. * - * The number of cached objects and pages can be read - * without holding any lock. + * The page queues must be locked when changing these counters. */ - -extern int vm_object_cached_count; - -extern int vm_object_cached_pages; -decl_simple_lock_data(extern,vm_object_cached_pages_lock_data) - -#define vm_object_cached_pages_update(page_count) \ - MACRO_BEGIN \ - simple_lock(&vm_object_cached_pages_lock_data); \ - vm_object_cached_pages += (page_count); \ - simple_unlock(&vm_object_cached_pages_lock_data); \ - MACRO_END +extern int vm_object_external_count; +extern int vm_object_external_pages; #endif /* _VM_VM_OBJECT_H_ */ -- cgit v1.2.3