Reverted most of r26641.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26658 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -58,7 +58,7 @@ static addr_t sPhysicalPageOffset;
|
|||||||
static size_t sNumPages;
|
static size_t sNumPages;
|
||||||
static size_t sReservedPages;
|
static size_t sReservedPages;
|
||||||
static vint32 sPageDeficit;
|
static vint32 sPageDeficit;
|
||||||
static size_t sModifiedNoSwapPages;
|
static size_t sModifiedTemporaryPages;
|
||||||
|
|
||||||
static ConditionVariable sFreePageCondition;
|
static ConditionVariable sFreePageCondition;
|
||||||
static spinlock sPageLock;
|
static spinlock sPageLock;
|
||||||
@@ -621,8 +621,8 @@ dump_page_stats(int argc, char **argv)
|
|||||||
sFreePageQueue.count);
|
sFreePageQueue.count);
|
||||||
kprintf("clear queue: %p, count = %ld\n", &sClearPageQueue,
|
kprintf("clear queue: %p, count = %ld\n", &sClearPageQueue,
|
||||||
sClearPageQueue.count);
|
sClearPageQueue.count);
|
||||||
kprintf("modified queue: %p, count = %ld (%ld no_swap)\n",
|
kprintf("modified queue: %p, count = %ld (%ld temporary)\n",
|
||||||
&sModifiedPageQueue, sModifiedPageQueue.count, sModifiedNoSwapPages);
|
&sModifiedPageQueue, sModifiedPageQueue.count, sModifiedTemporaryPages);
|
||||||
kprintf("active queue: %p, count = %ld\n", &sActivePageQueue,
|
kprintf("active queue: %p, count = %ld\n", &sActivePageQueue,
|
||||||
sActivePageQueue.count);
|
sActivePageQueue.count);
|
||||||
kprintf("inactive queue: %p, count = %ld\n", &sInactivePageQueue,
|
kprintf("inactive queue: %p, count = %ld\n", &sInactivePageQueue,
|
||||||
@@ -708,15 +708,11 @@ set_page_state_nolock(vm_page *page, int pageState)
|
|||||||
if (pageState != PAGE_STATE_INACTIVE && page->cache != NULL)
|
if (pageState != PAGE_STATE_INACTIVE && page->cache != NULL)
|
||||||
panic("to be freed page %p has cache", page);
|
panic("to be freed page %p has cache", page);
|
||||||
}
|
}
|
||||||
if (page->cache != NULL && page->cache->temporary
|
if (page->cache != NULL && page->cache->temporary) {
|
||||||
#if ENABLE_SWAP_SUPPORT
|
|
||||||
&& page->wired_count > 0
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
if (pageState == PAGE_STATE_MODIFIED)
|
if (pageState == PAGE_STATE_MODIFIED)
|
||||||
sModifiedNoSwapPages++;
|
sModifiedTemporaryPages++;
|
||||||
else if (page->state == PAGE_STATE_MODIFIED)
|
else if (page->state == PAGE_STATE_MODIFIED)
|
||||||
sModifiedNoSwapPages--;
|
sModifiedTemporaryPages--;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PAGE_ALLOCATION_TRACING
|
#ifdef PAGE_ALLOCATION_TRACING
|
||||||
@@ -751,12 +747,8 @@ move_page_to_active_or_inactive_queue(vm_page *page, bool dequeued)
|
|||||||
page->state = state;
|
page->state = state;
|
||||||
enqueue_page(state == PAGE_STATE_ACTIVE
|
enqueue_page(state == PAGE_STATE_ACTIVE
|
||||||
? &sActivePageQueue : &sInactivePageQueue, page);
|
? &sActivePageQueue : &sInactivePageQueue, page);
|
||||||
if (page->cache->temporary) {
|
if (page->cache->temporary)
|
||||||
#if ENABLE_SWAP_SUPPORT
|
sModifiedTemporaryPages--;
|
||||||
if (page->wired_count > 0)
|
|
||||||
#endif
|
|
||||||
sModifiedNoSwapPages--;
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
set_page_state_nolock(page, state);
|
set_page_state_nolock(page, state);
|
||||||
}
|
}
|
||||||
@@ -961,7 +953,7 @@ page_writer(void* /*unused*/)
|
|||||||
marker.state = PAGE_STATE_UNUSED;
|
marker.state = PAGE_STATE_UNUSED;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (sModifiedPageQueue.count - sModifiedNoSwapPages < 1024) {
|
if (sModifiedPageQueue.count - sModifiedTemporaryPages < 1024) {
|
||||||
int32 count = 0;
|
int32 count = 0;
|
||||||
get_sem_count(sWriterWaitSem, &count);
|
get_sem_count(sWriterWaitSem, &count);
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
@@ -1001,8 +993,8 @@ page_writer(void* /*unused*/)
|
|||||||
// Don't write back wired (locked) pages and don't write RAM pages
|
// Don't write back wired (locked) pages and don't write RAM pages
|
||||||
// until we're low on pages.
|
// until we're low on pages.
|
||||||
if (page->wired_count > 0
|
if (page->wired_count > 0
|
||||||
#if ENABLE_SWAP_SUPPORT
|
|
||||||
|| cache->temporary
|
|| cache->temporary
|
||||||
|
#if ENABLE_SWAP_SUPPORT
|
||||||
&& low_resource_state(B_KERNEL_RESOURCE_PAGES)
|
&& low_resource_state(B_KERNEL_RESOURCE_PAGES)
|
||||||
== B_NO_LOW_RESOURCE
|
== B_NO_LOW_RESOURCE
|
||||||
#endif
|
#endif
|
||||||
@@ -1828,10 +1820,7 @@ vm_page_free(vm_cache *cache, vm_page *page)
|
|||||||
|
|
||||||
if (page->cache == NULL && page->state == PAGE_STATE_MODIFIED
|
if (page->cache == NULL && page->state == PAGE_STATE_MODIFIED
|
||||||
&& cache->temporary) {
|
&& cache->temporary) {
|
||||||
#if ENABLE_SWAP_SUPPORT
|
sModifiedTemporaryPages--;
|
||||||
if (page->wired_count > 0)
|
|
||||||
#endif
|
|
||||||
sModifiedNoSwapPages--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_page_state_nolock(page, PAGE_STATE_FREE);
|
set_page_state_nolock(page, PAGE_STATE_FREE);
|
||||||
|
|||||||
Reference in New Issue
Block a user