kernel/vm: Rename vm_page::busy_writing to busy_io.
This way, it's clear that it can be used for more than just writing. Change-Id: Ifd0928f0e8ec7b5eeb312795ceaae6e3fd266257 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10590 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
dcf4948bff
commit
2b9d1bb9c2
@@ -146,7 +146,7 @@ private:
|
|||||||
uint8 state : 3;
|
uint8 state : 3;
|
||||||
public:
|
public:
|
||||||
bool busy : 1;
|
bool busy : 1;
|
||||||
bool busy_writing : 1;
|
bool busy_io : 1;
|
||||||
bool accessed : 1;
|
bool accessed : 1;
|
||||||
bool modified : 1;
|
bool modified : 1;
|
||||||
uint8 _unused : 1;
|
uint8 _unused : 1;
|
||||||
@@ -207,7 +207,7 @@ vm_page::Init(page_num_t pageNumber)
|
|||||||
SetCacheRef(NULL);
|
SetCacheRef(NULL);
|
||||||
|
|
||||||
InitState(PAGE_STATE_FREE);
|
InitState(PAGE_STATE_FREE);
|
||||||
busy = busy_writing = false;
|
busy = busy_io = false;
|
||||||
accessed = modified = false;
|
accessed = modified = false;
|
||||||
_unused = 0;
|
_unused = 0;
|
||||||
usage_count = 0;
|
usage_count = 0;
|
||||||
|
|||||||
@@ -1119,16 +1119,16 @@ VMCache::_FreePageRange(VMCachePagesTree::Iterator it,
|
|||||||
page = it.Next()) {
|
page = it.Next()) {
|
||||||
|
|
||||||
if (page->busy) {
|
if (page->busy) {
|
||||||
if (!page->busy_writing) {
|
if (!page->busy_io) {
|
||||||
// wait for page to become unbusy
|
// wait for page to become unbusy
|
||||||
WaitForPageEvents(page, PAGE_EVENT_NOT_BUSY, true);
|
WaitForPageEvents(page, PAGE_EVENT_NOT_BUSY, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We cannot wait for the page to become available
|
// We cannot wait for the page to become available
|
||||||
// as we might cause a deadlock this way
|
// as we might cause a deadlock that way
|
||||||
page->busy_writing = false;
|
page->busy_io = false;
|
||||||
// this will notify the writer to free the page
|
// this will notify the reader/writer to free the page
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(page->WiredCount() == 0);
|
ASSERT(page->WiredCount() == 0);
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ list_page(vm_page* page)
|
|||||||
}
|
}
|
||||||
kprintf(" ");
|
kprintf(" ");
|
||||||
if (page->busy) kprintf("B"); else kprintf("-");
|
if (page->busy) kprintf("B"); else kprintf("-");
|
||||||
if (page->busy_writing) kprintf("W"); else kprintf("-");
|
if (page->busy_io) kprintf("I"); else kprintf("-");
|
||||||
if (page->accessed) kprintf("A"); else kprintf("-");
|
if (page->accessed) kprintf("A"); else kprintf("-");
|
||||||
if (page->modified) kprintf("M"); else kprintf("-");
|
if (page->modified) kprintf("M"); else kprintf("-");
|
||||||
kprintf("-");
|
kprintf("-");
|
||||||
@@ -986,7 +986,7 @@ dump_page_long(int argc, char **argv)
|
|||||||
kprintf("wired_count: %d\n", page->WiredCount());
|
kprintf("wired_count: %d\n", page->WiredCount());
|
||||||
kprintf("usage_count: %d\n", page->usage_count);
|
kprintf("usage_count: %d\n", page->usage_count);
|
||||||
kprintf("busy: %d\n", page->busy);
|
kprintf("busy: %d\n", page->busy);
|
||||||
kprintf("busy_writing: %d\n", page->busy_writing);
|
kprintf("busy_io: %d\n", page->busy_io);
|
||||||
kprintf("accessed: %d\n", page->accessed);
|
kprintf("accessed: %d\n", page->accessed);
|
||||||
kprintf("modified: %d\n", page->modified);
|
kprintf("modified: %d\n", page->modified);
|
||||||
#if DEBUG_PAGE_QUEUE
|
#if DEBUG_PAGE_QUEUE
|
||||||
@@ -2057,7 +2057,7 @@ PageWriteWrapper::SetTo(vm_page* page)
|
|||||||
fIsActive = true;
|
fIsActive = true;
|
||||||
|
|
||||||
fPage->busy = true;
|
fPage->busy = true;
|
||||||
fPage->busy_writing = true;
|
fPage->busy_io = true;
|
||||||
|
|
||||||
// We have a modified page -- however, while we're writing it back,
|
// We have a modified page -- however, while we're writing it back,
|
||||||
// the page might still be mapped. In order not to lose any changes to the
|
// the page might still be mapped. In order not to lose any changes to the
|
||||||
@@ -2091,14 +2091,14 @@ PageWriteWrapper::Done(status_t result)
|
|||||||
|
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
|
||||||
if (!fPage->busy_writing) {
|
if (!fPage->busy_io) {
|
||||||
// The busy_writing flag was cleared. That means the cache tried to remove
|
// The busy_io flag was cleared. That means the cache tried to remove
|
||||||
// the page while we were trying to write it. Let the cache handle the rest.
|
// the page while we were trying to write it. Let the cache handle the rest.
|
||||||
fCache->FreeRemovedPage(fPage);
|
fCache->FreeRemovedPage(fPage);
|
||||||
} else if (result == B_OK) {
|
} else if (result == B_OK) {
|
||||||
// put it into the active/inactive queue
|
// put it into the active/inactive queue
|
||||||
move_page_to_appropriate_queue(fPage);
|
move_page_to_appropriate_queue(fPage);
|
||||||
fPage->busy_writing = false;
|
fPage->busy_io = false;
|
||||||
DEBUG_PAGE_ACCESS_END(fPage);
|
DEBUG_PAGE_ACCESS_END(fPage);
|
||||||
|
|
||||||
fCache->NotifyPageEvents(fPage, PAGE_EVENT_NOT_BUSY);
|
fCache->NotifyPageEvents(fPage, PAGE_EVENT_NOT_BUSY);
|
||||||
@@ -2119,7 +2119,7 @@ PageWriteWrapper::Done(status_t result)
|
|||||||
else
|
else
|
||||||
set_page_state(fPage, PAGE_STATE_INACTIVE);
|
set_page_state(fPage, PAGE_STATE_INACTIVE);
|
||||||
|
|
||||||
fPage->busy_writing = false;
|
fPage->busy_io = false;
|
||||||
DEBUG_PAGE_ACCESS_END(fPage);
|
DEBUG_PAGE_ACCESS_END(fPage);
|
||||||
|
|
||||||
fCache->NotifyPageEvents(fPage, PAGE_EVENT_NOT_BUSY);
|
fCache->NotifyPageEvents(fPage, PAGE_EVENT_NOT_BUSY);
|
||||||
|
|||||||
Reference in New Issue
Block a user