mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
parent
ff7e8086d7
commit
21b2b7e1ea
68
repos/dde_rump/patches/vm_vfs.patch
Normal file
68
repos/dde_rump/patches/vm_vfs.patch
Normal file
@ -0,0 +1,68 @@
|
||||
--- src/lib/dde_rump/src/sys/rump/librump/rumpvfs/vm_vfs.c
|
||||
+++ src/lib/dde_rump/src/sys/rump/librump/rumpvfs/vm_vfs.c
|
||||
@@ -49,6 +49,7 @@
|
||||
struct vm_page **pgs;
|
||||
vaddr_t va;
|
||||
int pageout = 0;
|
||||
+ bool const write = BUF_ISWRITE(bp);
|
||||
|
||||
KASSERT(npages > 0);
|
||||
pgs = kmem_alloc(npages * sizeof(*pgs), KM_SLEEP);
|
||||
@@ -64,8 +65,47 @@
|
||||
KASSERT(uobj == pgs[i]->uobject);
|
||||
}
|
||||
|
||||
+ if (bp->b_error) {
|
||||
+ if (!write) {
|
||||
+ pgs[i]->flags |= PG_RELEASED;
|
||||
+ continue;
|
||||
+ } else if (bp->b_error == ENOMEM) {
|
||||
+ if (pgs[i]->flags & PG_PAGEOUT) {
|
||||
+ pageout++;
|
||||
+ pgs[i]->flags &= ~PG_PAGEOUT;
|
||||
+ }
|
||||
+ pgs[i]->flags &= ~PG_CLEAN;
|
||||
+
|
||||
+ mutex_enter(&uvm_pageqlock);
|
||||
+ uvm_pageactivate(pgs[i]);
|
||||
+ mutex_exit(&uvm_pageqlock);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * if the page is PG_FAKE, this must have been a read to
|
||||
+ * initialize the page. clear PG_FAKE and activate the page.
|
||||
+ * we must also clear the pmap "modified" flag since it may
|
||||
+ * still be set from the page's previous identity.
|
||||
+ */
|
||||
+
|
||||
+ if ((pgs[i]->flags & PG_FAKE)) {
|
||||
+ KASSERT(!write);
|
||||
+ pgs[i]->flags &= ~PG_FAKE;
|
||||
+ KASSERT((pgs[i]->flags & PG_CLEAN) != 0);
|
||||
+
|
||||
+#if defined(READAHEAD_STATS)
|
||||
+ pgs[i]->pqflags |= PQ_READAHEAD;
|
||||
+ uvm_ra_total.ev_count++;
|
||||
+#endif /* defined(READAHEAD_STATS) */
|
||||
+
|
||||
+ mutex_enter(&uvm_pageqlock);
|
||||
+ uvm_pageenqueue(pgs[i]);
|
||||
+ pmap_clear_modify(pgs[i]);
|
||||
+ mutex_exit(&uvm_pageqlock);
|
||||
+ }
|
||||
+
|
||||
if (pgs[i]->flags & PG_PAGEOUT) {
|
||||
- KASSERT((pgs[i]->flags & PG_FAKE) == 0);
|
||||
pageout++;
|
||||
pgs[i]->flags &= ~PG_PAGEOUT;
|
||||
pgs[i]->flags |= PG_RELEASED;
|
||||
@@ -81,7 +121,7 @@
|
||||
uvm_pagermapout((vaddr_t)bp->b_data, npages);
|
||||
uvm_pageout_done(pageout);
|
||||
|
||||
- if (BUF_ISWRITE(bp) && (bp->b_cflags & BC_AGE) != 0) {
|
||||
+ if (write && (bp->b_cflags & BC_AGE) != 0) {
|
||||
mutex_enter(bp->b_objlock);
|
||||
vwakeup(bp);
|
||||
mutex_exit(bp->b_objlock);
|
@ -1 +1 @@
|
||||
88651ddaf056424fee8354603d57c8fd34ef4e05
|
||||
e82aa761750a0a1e76e886fa7ad37da043afe931
|
||||
|
@ -4,3 +4,5 @@ DOWNLOADS := rump.git
|
||||
URL(rump) := https://github.com/ssumpf/rump.git
|
||||
DIR(rump) := src/lib/dde_rump
|
||||
REV(rump) := 206ffa06cedd0779af0043997fd182b00ff4688c
|
||||
|
||||
PATCHES := patches/vm_vfs.patch
|
||||
|
Loading…
x
Reference in New Issue
Block a user