[haiku-commits] r35013 - in haiku/trunk: headers/private/kernel/vm src/system/kernel/vm

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 11 Jan 2010 20:13:14 +0100 (CET)

Author: bonefish
Date: 2010-01-11 20:13:14 +0100 (Mon, 11 Jan 2010)
New Revision: 35013
Changeset: http://dev.haiku-os.org/changeset/35013/haiku

Modified:
   haiku/trunk/headers/private/kernel/vm/vm_types.h
   haiku/trunk/src/system/kernel/vm/vm.cpp
   haiku/trunk/src/system/kernel/vm/vm_page.cpp
Log:
PAGE_TYPE_GUARD was unused and for the other two types a simple one bit flag
suffices. Therefore replaced vm_page::type by vm_page::is_dummy.


Modified: haiku/trunk/headers/private/kernel/vm/vm_types.h
===================================================================
--- haiku/trunk/headers/private/kernel/vm/vm_types.h    2010-01-11 18:04:14 UTC 
(rev 35012)
+++ haiku/trunk/headers/private/kernel/vm/vm_types.h    2010-01-11 19:13:14 UTC 
(rev 35013)
@@ -94,21 +94,16 @@
        vint32                                  accessing_thread;
 #endif
 
-       uint8                                   type : 2;
+       uint8                                   is_dummy : 1;
        uint8                                   state : 3;
        uint8                                   busy_writing : 1;
-       uint8                                   unused : 2;
                // used in VMAnonymousCache::Merge()
+       uint8                                   unused : 3;
 
        int8                                    usage_count;
        uint16                                  wired_count;
 };
 
-enum {
-       PAGE_TYPE_PHYSICAL = 0,
-       PAGE_TYPE_DUMMY,
-       PAGE_TYPE_GUARD
-};
 
 enum {
        PAGE_STATE_ACTIVE = 0,

Modified: haiku/trunk/src/system/kernel/vm/vm.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm.cpp     2010-01-11 18:04:14 UTC (rev 
35012)
+++ haiku/trunk/src/system/kernel/vm/vm.cpp     2010-01-11 19:13:14 UTC (rev 
35013)
@@ -2767,16 +2767,15 @@
        if (showPages) {
                for (VMCachePagesTree::Iterator it = cache->pages.GetIterator();
                                vm_page* page = it.Next();) {
-                       if (page->type == PAGE_TYPE_PHYSICAL) {
-                               kprintf("\t%p ppn 0x%lx offset 0x%lx type %u 
state %u (%s) "
+                       if (!page->is_dummy) {
+                               kprintf("\t%p ppn 0x%lx offset 0x%lx state %u 
(%s) "
                                        "wired_count %u\n", page, 
page->physical_page_number,
-                                       page->cache_offset, page->type, 
page->state,
+                                       page->cache_offset, page->state,
                                        page_state_to_string(page->state), 
page->wired_count);
-                       } else if(page->type == PAGE_TYPE_DUMMY) {
+                       } else {
                                kprintf("\t%p DUMMY PAGE state %u (%s)\n",
                                        page, page->state, 
page_state_to_string(page->state));
-                       } else
-                               kprintf("\t%p UNKNOWN PAGE type %u\n", page, 
page->type);
+                       }
                }
        } else
                kprintf("\t%ld in cache\n", cache->page_count);

Modified: haiku/trunk/src/system/kernel/vm/vm_page.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm_page.cpp        2010-01-11 18:04:14 UTC 
(rev 35012)
+++ haiku/trunk/src/system/kernel/vm/vm_page.cpp        2010-01-11 19:13:14 UTC 
(rev 35013)
@@ -408,7 +408,7 @@
        kprintf("cache:           %p\n", page->cache);
        kprintf("cache_offset:    %ld\n", page->cache_offset);
        kprintf("cache_next:      %p\n", page->cache_next);
-       kprintf("type:            %d\n", page->type);
+       kprintf("is dummy:        %d\n", page->is_dummy);
        kprintf("state:           %s\n", page_state_to_string(page->state));
        kprintf("wired_count:     %d\n", page->wired_count);
        kprintf("usage_count:     %d\n", page->usage_count);
@@ -861,7 +861,7 @@
 static inline bool
 is_marker_page(struct vm_page *page)
 {
-       return page->type == PAGE_TYPE_DUMMY;
+       return page->is_dummy;
 }
 
 
@@ -1359,7 +1359,7 @@
        }
 
        vm_page marker;
-       marker.type = PAGE_TYPE_DUMMY;
+       marker.is_dummy = true;
        marker.cache = NULL;
        marker.state = PAGE_STATE_UNUSED;
 #if DEBUG_PAGE_QUEUE
@@ -1586,7 +1586,7 @@
 {
        while (true) {
                vm_page marker;
-               marker.type = PAGE_TYPE_DUMMY;
+               marker.is_dummy = true;
                marker.cache = NULL;
                marker.state = PAGE_STATE_UNUSED;
 #if DEBUG_PAGE_QUEUE
@@ -1884,7 +1884,7 @@
        // initialize the free page table
        for (uint32 i = 0; i < sNumPages; i++) {
                sPages[i].physical_page_number = sPhysicalPageOffset + i;
-               sPages[i].type = PAGE_TYPE_PHYSICAL;
+               sPages[i].is_dummy = false;
                sPages[i].state = PAGE_STATE_FREE;
                new(&sPages[i].mappings) vm_page_mappings();
                sPages[i].wired_count = 0;


Other related posts:

  • » [haiku-commits] r35013 - in haiku/trunk: headers/private/kernel/vm src/system/kernel/vm - ingo_weinhold