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:
parent
7832e54913
commit
d3374bdc15
@ -58,7 +58,7 @@ static addr_t sPhysicalPageOffset;
|
||||
static size_t sNumPages;
|
||||
static size_t sReservedPages;
|
||||
static vint32 sPageDeficit;
|
||||
static size_t sModifiedNoSwapPages;
|
||||
static size_t sModifiedTemporaryPages;
|
||||
|
||||
static ConditionVariable sFreePageCondition;
|
||||
static spinlock sPageLock;
|
||||
@ -621,8 +621,8 @@ dump_page_stats(int argc, char **argv)
|
||||
sFreePageQueue.count);
|
||||
kprintf("clear queue: %p, count = %ld\n", &sClearPageQueue,
|
||||
sClearPageQueue.count);
|
||||
kprintf("modified queue: %p, count = %ld (%ld no_swap)\n",
|
||||
&sModifiedPageQueue, sModifiedPageQueue.count, sModifiedNoSwapPages);
|
||||
kprintf("modified queue: %p, count = %ld (%ld temporary)\n",
|
||||
&sModifiedPageQueue, sModifiedPageQueue.count, sModifiedTemporaryPages);
|
||||
kprintf("active queue: %p, count = %ld\n", &sActivePageQueue,
|
||||
sActivePageQueue.count);
|
||||
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)
|
||||
panic("to be freed page %p has cache", page);
|
||||
}
|
||||
if (page->cache != NULL && page->cache->temporary
|
||||
#if ENABLE_SWAP_SUPPORT
|
||||
&& page->wired_count > 0
|
||||
#endif
|
||||
) {
|
||||
if (page->cache != NULL && page->cache->temporary) {
|
||||
if (pageState == PAGE_STATE_MODIFIED)
|
||||
sModifiedNoSwapPages++;
|
||||
sModifiedTemporaryPages++;
|
||||
else if (page->state == PAGE_STATE_MODIFIED)
|
||||
sModifiedNoSwapPages--;
|
||||
sModifiedTemporaryPages--;
|
||||
}
|
||||
|
||||
#ifdef PAGE_ALLOCATION_TRACING
|
||||
@ -751,12 +747,8 @@ move_page_to_active_or_inactive_queue(vm_page *page, bool dequeued)
|
||||
page->state = state;
|
||||
enqueue_page(state == PAGE_STATE_ACTIVE
|
||||
? &sActivePageQueue : &sInactivePageQueue, page);
|
||||
if (page->cache->temporary) {
|
||||
#if ENABLE_SWAP_SUPPORT
|
||||
if (page->wired_count > 0)
|
||||
#endif
|
||||
sModifiedNoSwapPages--;
|
||||
}
|
||||
if (page->cache->temporary)
|
||||
sModifiedTemporaryPages--;
|
||||
} else
|
||||
set_page_state_nolock(page, state);
|
||||
}
|
||||
@ -961,7 +953,7 @@ page_writer(void* /*unused*/)
|
||||
marker.state = PAGE_STATE_UNUSED;
|
||||
|
||||
while (true) {
|
||||
if (sModifiedPageQueue.count - sModifiedNoSwapPages < 1024) {
|
||||
if (sModifiedPageQueue.count - sModifiedTemporaryPages < 1024) {
|
||||
int32 count = 0;
|
||||
get_sem_count(sWriterWaitSem, &count);
|
||||
if (count == 0)
|
||||
@ -1001,8 +993,8 @@ page_writer(void* /*unused*/)
|
||||
// Don't write back wired (locked) pages and don't write RAM pages
|
||||
// until we're low on pages.
|
||||
if (page->wired_count > 0
|
||||
#if ENABLE_SWAP_SUPPORT
|
||||
|| cache->temporary
|
||||
#if ENABLE_SWAP_SUPPORT
|
||||
&& low_resource_state(B_KERNEL_RESOURCE_PAGES)
|
||||
== B_NO_LOW_RESOURCE
|
||||
#endif
|
||||
@ -1828,10 +1820,7 @@ vm_page_free(vm_cache *cache, vm_page *page)
|
||||
|
||||
if (page->cache == NULL && page->state == PAGE_STATE_MODIFIED
|
||||
&& cache->temporary) {
|
||||
#if ENABLE_SWAP_SUPPORT
|
||||
if (page->wired_count > 0)
|
||||
#endif
|
||||
sModifiedNoSwapPages--;
|
||||
sModifiedTemporaryPages--;
|
||||
}
|
||||
|
||||
set_page_state_nolock(page, PAGE_STATE_FREE);
|
||||
|
Loading…
Reference in New Issue
Block a user