Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
da9fcbf4
Commit
da9fcbf4
authored
Apr 14, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
39c5b729
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
bigfile/virtmem.c
bigfile/virtmem.c
+5
-11
No files found.
bigfile/virtmem.c
View file @
da9fcbf4
...
@@ -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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment