summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/9/port/page.c7
-rw-r--r--sys/src/9/port/portdat.h3
-rw-r--r--sys/src/9/port/segment.c1
3 files changed, 8 insertions, 3 deletions
diff --git a/sys/src/9/port/page.c b/sys/src/9/port/page.c
index e8c5b6ce0..50cb4efca 100644
--- a/sys/src/9/port/page.c
+++ b/sys/src/9/port/page.c
@@ -228,6 +228,9 @@ putpage(Page *p)
return;
}
+ if(p->image && p->image->nocache)
+ uncachepage(p);
+
if(p->image && p->image != &swapimage)
pagechaintail(p);
else
@@ -291,8 +294,8 @@ duppage(Page *p) /* Always call with p locked */
return;
}
- /* No freelist cache when memory is very low */
- if(palloc.freecount < swapalloc.highwater) {
+ /* No freelist cache with uncached image or when memory is very low */
+ if(p->image->nocache || palloc.freecount < swapalloc.highwater) {
unlock(&palloc);
uncachepage(p);
return;
diff --git a/sys/src/9/port/portdat.h b/sys/src/9/port/portdat.h
index 84545077b..2cad12930 100644
--- a/sys/src/9/port/portdat.h
+++ b/sys/src/9/port/portdat.h
@@ -352,7 +352,8 @@ struct Image
Segment *s; /* TEXT segment for image if running */
Image *hash; /* Qid hash chains */
Image *next; /* Free list */
- int notext; /* no file associated */
+ char notext; /* no file associated */
+ char nocache; /* no freelist page caching */
};
struct Pte
diff --git a/sys/src/9/port/segment.c b/sys/src/9/port/segment.c
index c71eb43e6..1e263fd43 100644
--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -275,6 +275,7 @@ attachimage(int type, Chan *c, ulong base, ulong len)
lock(i);
incref(c);
+ i->nocache = (c->flag & CCACHE) == 0;
c->flag &= ~CCACHE;
i->c = c;
i->type = c->type;