Add a different approach to calm down page fault handling when debug output is enabled.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9443 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+10
-4
@@ -41,11 +41,17 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
//#define TRACE_VM
|
//#define TRACE_VM
|
||||||
|
//#define TRACE_FAULTS
|
||||||
#ifdef TRACE_VM
|
#ifdef TRACE_VM
|
||||||
# define TRACE(x) dprintf x
|
# define TRACE(x) dprintf x
|
||||||
#else
|
#else
|
||||||
# define TRACE(x) ;
|
# define TRACE(x) ;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef TRACE_FAULTS
|
||||||
|
# define FTRACE(x) dprintf x
|
||||||
|
#else
|
||||||
|
# define FTRACE(x) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ROUNDUP(a, b) (((a) + ((b)-1)) & ~((b)-1))
|
#define ROUNDUP(a, b) (((a) + ((b)-1)) & ~((b)-1))
|
||||||
#define ROUNDOWN(a, b) (((a) / (b)) * (b))
|
#define ROUNDOWN(a, b) (((a) / (b)) * (b))
|
||||||
@@ -2069,7 +2075,7 @@ vm_page_fault(addr_t address, addr_t fault_address, bool is_write, bool is_user,
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
TRACE(("vm_page_fault: page fault at 0x%lx, ip 0x%lx\n", address, fault_address));
|
FTRACE(("vm_page_fault: page fault at 0x%lx, ip 0x%lx\n", address, fault_address));
|
||||||
|
|
||||||
*newip = 0;
|
*newip = 0;
|
||||||
|
|
||||||
@@ -2115,7 +2121,7 @@ vm_soft_fault(addr_t originalAddress, bool isWrite, bool isUser)
|
|||||||
int change_count;
|
int change_count;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
TRACE(("vm_soft_fault: thid 0x%lx address 0x%lx, isWrite %d, isUser %d\n",
|
FTRACE(("vm_soft_fault: thid 0x%lx address 0x%lx, isWrite %d, isUser %d\n",
|
||||||
thread_get_current_thread_id(), originalAddress, isWrite, isUser));
|
thread_get_current_thread_id(), originalAddress, isWrite, isUser));
|
||||||
|
|
||||||
address = ROUNDOWN(originalAddress, B_PAGE_SIZE);
|
address = ROUNDOWN(originalAddress, B_PAGE_SIZE);
|
||||||
@@ -2268,7 +2274,7 @@ vm_soft_fault(addr_t originalAddress, bool isWrite, bool isUser)
|
|||||||
if (page == NULL) {
|
if (page == NULL) {
|
||||||
// we still haven't found a page, so we allocate a clean one
|
// we still haven't found a page, so we allocate a clean one
|
||||||
page = vm_page_allocate_page(PAGE_STATE_CLEAR);
|
page = vm_page_allocate_page(PAGE_STATE_CLEAR);
|
||||||
TRACE(("vm_soft_fault: just allocated page 0x%lx\n", page->ppn));
|
FTRACE(("vm_soft_fault: just allocated page 0x%lx\n", page->ppn));
|
||||||
|
|
||||||
// Insert the new page into our cache, and replace it with the dummy page if necessary
|
// Insert the new page into our cache, and replace it with the dummy page if necessary
|
||||||
|
|
||||||
@@ -2302,7 +2308,7 @@ vm_soft_fault(addr_t originalAddress, bool isWrite, bool isUser)
|
|||||||
vm_page *src_page = page;
|
vm_page *src_page = page;
|
||||||
void *src, *dest;
|
void *src, *dest;
|
||||||
|
|
||||||
TRACE(("get new page, copy it, and put it into the topmost cache\n"));
|
FTRACE(("get new page, copy it, and put it into the topmost cache\n"));
|
||||||
page = vm_page_allocate_page(PAGE_STATE_FREE);
|
page = vm_page_allocate_page(PAGE_STATE_FREE);
|
||||||
|
|
||||||
// try to get a mapping for the src and dest page so we can copy it
|
// try to get a mapping for the src and dest page so we can copy it
|
||||||
|
|||||||
Reference in New Issue
Block a user