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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35013 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -94,21 +94,16 @@ struct vm_page {
|
|||||||
vint32 accessing_thread;
|
vint32 accessing_thread;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8 type : 2;
|
uint8 is_dummy : 1;
|
||||||
uint8 state : 3;
|
uint8 state : 3;
|
||||||
uint8 busy_writing : 1;
|
uint8 busy_writing : 1;
|
||||||
uint8 unused : 2;
|
|
||||||
// used in VMAnonymousCache::Merge()
|
// used in VMAnonymousCache::Merge()
|
||||||
|
uint8 unused : 3;
|
||||||
|
|
||||||
int8 usage_count;
|
int8 usage_count;
|
||||||
uint16 wired_count;
|
uint16 wired_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
|
||||||
PAGE_TYPE_PHYSICAL = 0,
|
|
||||||
PAGE_TYPE_DUMMY,
|
|
||||||
PAGE_TYPE_GUARD
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PAGE_STATE_ACTIVE = 0,
|
PAGE_STATE_ACTIVE = 0,
|
||||||
|
|||||||
@@ -2767,16 +2767,15 @@ dump_cache(int argc, char** argv)
|
|||||||
if (showPages) {
|
if (showPages) {
|
||||||
for (VMCachePagesTree::Iterator it = cache->pages.GetIterator();
|
for (VMCachePagesTree::Iterator it = cache->pages.GetIterator();
|
||||||
vm_page* page = it.Next();) {
|
vm_page* page = it.Next();) {
|
||||||
if (page->type == PAGE_TYPE_PHYSICAL) {
|
if (!page->is_dummy) {
|
||||||
kprintf("\t%p ppn 0x%lx offset 0x%lx type %u state %u (%s) "
|
kprintf("\t%p ppn 0x%lx offset 0x%lx state %u (%s) "
|
||||||
"wired_count %u\n", page, page->physical_page_number,
|
"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);
|
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",
|
kprintf("\t%p DUMMY PAGE state %u (%s)\n",
|
||||||
page, page->state, page_state_to_string(page->state));
|
page, page->state, page_state_to_string(page->state));
|
||||||
} else
|
}
|
||||||
kprintf("\t%p UNKNOWN PAGE type %u\n", page, page->type);
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
kprintf("\t%ld in cache\n", cache->page_count);
|
kprintf("\t%ld in cache\n", cache->page_count);
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ dump_page(int argc, char **argv)
|
|||||||
kprintf("cache: %p\n", page->cache);
|
kprintf("cache: %p\n", page->cache);
|
||||||
kprintf("cache_offset: %ld\n", page->cache_offset);
|
kprintf("cache_offset: %ld\n", page->cache_offset);
|
||||||
kprintf("cache_next: %p\n", page->cache_next);
|
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("state: %s\n", page_state_to_string(page->state));
|
||||||
kprintf("wired_count: %d\n", page->wired_count);
|
kprintf("wired_count: %d\n", page->wired_count);
|
||||||
kprintf("usage_count: %d\n", page->usage_count);
|
kprintf("usage_count: %d\n", page->usage_count);
|
||||||
@@ -861,7 +861,7 @@ page_scrubber(void *unused)
|
|||||||
static inline bool
|
static inline bool
|
||||||
is_marker_page(struct vm_page *page)
|
is_marker_page(struct vm_page *page)
|
||||||
{
|
{
|
||||||
return page->type == PAGE_TYPE_DUMMY;
|
return page->is_dummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1359,7 +1359,7 @@ page_writer(void* /*unused*/)
|
|||||||
}
|
}
|
||||||
|
|
||||||
vm_page marker;
|
vm_page marker;
|
||||||
marker.type = PAGE_TYPE_DUMMY;
|
marker.is_dummy = true;
|
||||||
marker.cache = NULL;
|
marker.cache = NULL;
|
||||||
marker.state = PAGE_STATE_UNUSED;
|
marker.state = PAGE_STATE_UNUSED;
|
||||||
#if DEBUG_PAGE_QUEUE
|
#if DEBUG_PAGE_QUEUE
|
||||||
@@ -1586,7 +1586,7 @@ steal_pages(vm_page **pages, size_t count)
|
|||||||
{
|
{
|
||||||
while (true) {
|
while (true) {
|
||||||
vm_page marker;
|
vm_page marker;
|
||||||
marker.type = PAGE_TYPE_DUMMY;
|
marker.is_dummy = true;
|
||||||
marker.cache = NULL;
|
marker.cache = NULL;
|
||||||
marker.state = PAGE_STATE_UNUSED;
|
marker.state = PAGE_STATE_UNUSED;
|
||||||
#if DEBUG_PAGE_QUEUE
|
#if DEBUG_PAGE_QUEUE
|
||||||
@@ -1884,7 +1884,7 @@ vm_page_init(kernel_args *args)
|
|||||||
// initialize the free page table
|
// initialize the free page table
|
||||||
for (uint32 i = 0; i < sNumPages; i++) {
|
for (uint32 i = 0; i < sNumPages; i++) {
|
||||||
sPages[i].physical_page_number = sPhysicalPageOffset + 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;
|
sPages[i].state = PAGE_STATE_FREE;
|
||||||
new(&sPages[i].mappings) vm_page_mappings();
|
new(&sPages[i].mappings) vm_page_mappings();
|
||||||
sPages[i].wired_count = 0;
|
sPages[i].wired_count = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user