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
c8e9e128
Commit
c8e9e128
authored
Dec 03, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3e26a9fc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+1
-0
bigfile/virtmem.c
bigfile/virtmem.c
+2
-7
No files found.
bigfile/tests/test_virtmem.c
View file @
c8e9e128
...
@@ -1125,6 +1125,7 @@ struct BigFileMMap {
...
@@ -1125,6 +1125,7 @@ struct BigFileMMap {
BigFile
;
BigFile
;
int
fd
;
/* fd of file to mmap */
int
fd
;
/* fd of file to mmap */
int
nstoreblk
;
/* number of times storeblk called */
int
nstoreblk
;
/* number of times storeblk called */
// XXX nremmap + check
int
nmunmap
;
/* ----//---- munmap called */
int
nmunmap
;
/* ----//---- munmap called */
};
};
typedef
struct
BigFileMMap
BigFileMMap
;
typedef
struct
BigFileMMap
BigFileMMap
;
...
...
bigfile/virtmem.c
View file @
c8e9e128
...
@@ -59,8 +59,7 @@ static int __ram_reclaim(RAM *ram);
...
@@ -59,8 +59,7 @@ static int __ram_reclaim(RAM *ram);
/* global lock which protects manipulating virtmem data structures
/* global lock which protects manipulating virtmem data structures
*
*
* NOTE not scalable, but this is temporary solution - as we are going to move
* NOTE not scalable. */
* memory management back into the kernel, where it is done properly. */
static
pthread_mutex_t
virtmem_lock
=
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
;
static
pthread_mutex_t
virtmem_lock
=
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
;
static
const
VirtGilHooks
*
virtmem_gilhooks
;
static
const
VirtGilHooks
*
virtmem_gilhooks
;
...
@@ -104,7 +103,7 @@ void virt_unlock()
...
@@ -104,7 +103,7 @@ void virt_unlock()
void
virt_lock_hookgil
(
const
VirtGilHooks
*
gilhooks
)
void
virt_lock_hookgil
(
const
VirtGilHooks
*
gilhooks
)
{
{
// FIXME we hit vvv assert for real because `import bigfile,
// FIXME we hit vvv assert for real because `import bigfile,
// wendelin.bigfile` import bigfile/__init__.py twice and that in turn
// wendelin.bigfile` import
s
bigfile/__init__.py twice and that in turn
// imports bigfile/_bigfile.so twice. However Python loads _bigfile.so DSO
// imports bigfile/_bigfile.so twice. However Python loads _bigfile.so DSO
// only once - oops. The bug happens in practice when running tests via
// only once - oops. The bug happens in practice when running tests via
// pytest under python3.
// pytest under python3.
...
@@ -216,9 +215,6 @@ void fileh_close(BigFileH *fileh)
...
@@ -216,9 +215,6 @@ void fileh_close(BigFileH *fileh)
BUG_ON
(
page
->
state
==
PAGE_LOADING
);
BUG_ON
(
page
->
state
==
PAGE_LOADING
);
page_drop_memory
(
page
);
page_drop_memory
(
page
);
page_del
(
page
);
page_del
(
page
);
// list_del(&page->lru);
// bzero(page, sizeof(*page)); /* just in case */
// free(page);
}
}
BUG_ON
(
!
list_empty
(
&
fileh
->
dirty_pages
));
BUG_ON
(
!
list_empty
(
&
fileh
->
dirty_pages
));
...
@@ -885,7 +881,6 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
...
@@ -885,7 +881,6 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
page
->
state
=
max
(
page
->
state
,
newstate
);
page
->
state
=
max
(
page
->
state
,
newstate
);
// XXX overlay: assert !vma->page_ismappedv[blk] XXX not ok? (retrying after virt unlock/lock)
// XXX overlay: assert !vma->page_ismappedv[blk] XXX not ok? (retrying after virt unlock/lock)
// XXX mmap page to all vma with .mmap_overlay=1 of this fileh.
vma_mmap_page
(
vma
,
page
);
vma_mmap_page
(
vma
,
page
);
/* wcfs: mmap the page to all wcfs-backed vmas. If we don't, the memory on
/* wcfs: mmap the page to all wcfs-backed vmas. If we don't, the memory on
...
...
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