Commit da9fcbf4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 39c5b729
...@@ -479,7 +479,6 @@ int fileh_dirty_writeout(BigFileH *fileh, enum WriteoutFlags flags) ...@@ -479,7 +479,6 @@ int fileh_dirty_writeout(BigFileH *fileh, enum WriteoutFlags flags)
* !wcfs: keep the page in RAM cache, even if it is not mapped anywhere */ * !wcfs: keep the page in RAM cache, even if it is not mapped anywhere */
if (fileh->mmap_overlay) { if (fileh->mmap_overlay) {
ASSERT(page->refcnt == 0); ASSERT(page->refcnt == 0);
// XXX -> page_drop(page)
pagemap_del(&fileh->pagemap, page->f_pgoffset); pagemap_del(&fileh->pagemap, page->f_pgoffset);
page_drop_memory(page); page_drop_memory(page);
page_del(page); page_del(page);
...@@ -518,14 +517,11 @@ void fileh_dirty_discard(BigFileH *fileh) ...@@ -518,14 +517,11 @@ void fileh_dirty_discard(BigFileH *fileh)
page = list_entry(hpage, typeof(*page), in_dirty); page = list_entry(hpage, typeof(*page), in_dirty);
BUG_ON(page->state != PAGE_DIRTY); BUG_ON(page->state != PAGE_DIRTY);
// FIXME do pagemap_del + drop_ram + page_del unconditionally page_drop_memory(page);
// (just need think again and to update !wcfs discard test) // TODO consider doing pagemap_del + page_del unconditionally
if (fileh->mmap_overlay) { if (fileh->mmap_overlay) {
pagemap_del(&fileh->pagemap, page->f_pgoffset); pagemap_del(&fileh->pagemap, page->f_pgoffset);
page_drop_memory(page);
page_del(page); page_del(page);
} else {
page_drop_memory(page);
} }
} }
...@@ -834,10 +830,6 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write) ...@@ -834,10 +830,6 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
if (page->state == PAGE_LOADING_INVALIDATED) { if (page->state == PAGE_LOADING_INVALIDATED) {
page_drop_memory(page); page_drop_memory(page);
page_del(page); page_del(page);
// XXX + pagemap_del ?
// list_del(&page->lru);
// bzero(page, sizeof(*page)); /* just in case */
// free(page);
} }
/* else just mark the page as loaded ok */ /* else just mark the page as loaded ok */
...@@ -1040,11 +1032,13 @@ static void page_drop_memory(Page *page) ...@@ -1040,11 +1032,13 @@ static void page_drop_memory(Page *page)
/* page_del deletes Page struct (but not page memory - see page_drop_memory). /* page_del deletes Page struct (but not page memory - see page_drop_memory).
* *
* The page must be in PAGE_EMPTY state.
* The page is removed from ram->lru. * The page is removed from ram->lru.
*/ */
static void page_del(Page *page) { static void page_del(Page *page) {
BUG_ON(page->refcnt != 0); BUG_ON(page->refcnt != 0);
BUG_ON(page->state == PAGE_DIRTY); // XXX + PAGE_LOADING ? XXX != PAGE_EMPTY ? BUG_ON(page->state != PAGE_EMPTY);
BUG_ON(!list_empty(&page->in_dirty));
list_del(&page->lru); list_del(&page->lru);
bzero(page, sizeof(*page)); /* just in case */ bzero(page, sizeof(*page)); /* just in case */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment