kernel - Remove object->agg_pv_list_count
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 26 Jan 2017 02:30:43 +0000 (18:30 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 26 Jan 2017 02:30:43 +0000 (18:30 -0800)
* Remove the object->agg_pv_list_count field.  It represents an unnecessary
  global cache bounce, was only being used to help report vkernel RSS,
  and wasn't working very well anyway.

sys/platform/pc64/include/pmap.h
sys/platform/pc64/x86_64/pmap.c
sys/vm/vm_map.h
sys/vm/vm_object.c
sys/vm/vm_object.h
sys/vm/vm_page.c

index 4196425..97da388 100644 (file)
@@ -385,34 +385,39 @@ pmap_emulate_ad_bits(pmap_t pmap) {
 /* Return various clipped indexes for a given VA */
 
 /*
- * Returns the index of a pte in a page table, representing a terminal
+ * Returns the index of a PTE in a PT, representing a terminal
  * page.
  */
 static __inline vm_pindex_t
 pmap_pte_index(vm_offset_t va)
 {
-
        return ((va >> PAGE_SHIFT) & ((1ul << NPTEPGSHIFT) - 1));
 }
 
+/*
+ * Returns the index of a PT in a PD
+ */
 static __inline vm_pindex_t
 pmap_pde_index(vm_offset_t va)
 {
-
        return ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1));
 }
 
+/*
+ * Returns the index of a PD in a PDP
+ */
 static __inline vm_pindex_t
 pmap_pdpe_index(vm_offset_t va)
 {
-
        return ((va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1));
 }
 
+/*
+ * Returns the index of a PDP in the PML4
+ */
 static __inline vm_pindex_t
 pmap_pml4e_index(vm_offset_t va)
 {
-
        return ((va >> PML4SHIFT) & ((1ul << NPML4EPGSHIFT) - 1));
 }
 
index 0b9d609..327eeb2 100644 (file)
@@ -2971,10 +2971,6 @@ pmap_remove_pv_page(pv_entry_t pv)
        pv->pv_m = NULL;
        TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
        pmap_page_stats_deleting(m);
-       /*
-       if (m->object)
-               atomic_add_int(&m->object->agg_pv_list_count, -1);
-       */
        if (TAILQ_EMPTY(&m->md.pv_list))
                vm_page_flag_clear(m, PG_MAPPED | PG_WRITEABLE);
        vm_page_spin_unlock(m);
index 44b5b1a..c9f0da3 100644 (file)
@@ -485,7 +485,6 @@ vmspace_president_count(struct vmspace *vmspace)
        vm_map_entry_t cur;
        vm_object_t object;
        u_int count = 0;
-       u_int n;
 
 #ifdef _KERNEL
        if (map->president_ticks == ticks / hz || vm_map_lock_read_try(map))
@@ -502,6 +501,8 @@ vmspace_president_count(struct vmspace *vmspace)
                            object->type != OBJT_SWAP) {
                                break;
                        }
+
+#if 0
                        /*
                         * synchronize non-zero case, contents of field
                         * can change at any time due to pmap ops.
@@ -512,6 +513,7 @@ vmspace_president_count(struct vmspace *vmspace)
 #endif
                                count += object->resident_page_count / n;
                        }
+#endif
                        break;
                default:
                        break;
index 263c977..2114d06 100644 (file)
@@ -382,7 +382,6 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
                vm_object_set_flag(object, OBJ_ONEMAPPING);
        object->paging_in_progress = 0;
        object->resident_page_count = 0;
-       object->agg_pv_list_count = 0;
        object->shadow_count = 0;
        /* cpu localization twist */
        object->pg_color = vm_quickcolor();
index d1ac928..b650211 100644 (file)
@@ -155,7 +155,7 @@ struct vm_object {
        u_short pg_color;               /* color of first page in obj */
        u_int paging_in_progress;       /* Paging (in or out) so don't collapse or destroy */
        long resident_page_count;       /* number of resident pages */
-        u_int agg_pv_list_count;        /* aggregate pv list count */
+        u_int unused01;
        struct vm_object *backing_object; /* object that I'm a shadow of */
        vm_ooffset_t backing_object_offset;/* Offset in backing object */
        TAILQ_ENTRY(vm_object) pager_object_list; /* list of all objects of this pager type */
index 147c221..3b41d27 100644 (file)
@@ -1208,7 +1208,6 @@ vm_page_insert(vm_page_t m, vm_object_t object, vm_pindex_t pindex)
        }
        ++object->resident_page_count;
        ++mycpu->gd_vmtotal.t_rm;
-       /* atomic_add_int(&object->agg_pv_list_count, m->md.pv_list_count); */
        vm_page_spin_unlock(m);
 
        /*
@@ -1263,7 +1262,6 @@ vm_page_remove(vm_page_t m)
        vm_page_rb_tree_RB_REMOVE(&object->rb_memq, m);
        --object->resident_page_count;
        --mycpu->gd_vmtotal.t_rm;
-       /* atomic_add_int(&object->agg_pv_list_count, -m->md.pv_list_count); */
        m->object = NULL;
        vm_page_spin_unlock(m);