summaryrefslogtreecommitdiff
path: root/sys/src/9/zynq
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-02-07 02:52:23 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-02-07 02:52:23 +0100
commitb8cf3cb879a19c001796329ebe266104d13e63be (patch)
tree745534899e603d5336347c846ad286c3535c43fc /sys/src/9/zynq
parentf215b660b30cc5e5d318922f545441b4ac14b200 (diff)
kernel: reduce Page structure size by changing Page.cachectl[]
there are no kernels currently that do page coloring, so the only use of cachectl[] is flushing the icache (on arm and ppc). on pc64, cachectl consumes 32 bytes in each page resulting in over 200 megabytes of overhead for 32gb of ram with 4K pages. this change removes cachectl[] and adds txtflush ulong that is set to ~0 by pio() to instruct putmmu() to flush the icache.
Diffstat (limited to 'sys/src/9/zynq')
-rw-r--r--sys/src/9/zynq/main.c2
-rw-r--r--sys/src/9/zynq/mmu.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/sys/src/9/zynq/main.c b/sys/src/9/zynq/main.c
index c27879f75..f8a103b11 100644
--- a/sys/src/9/zynq/main.c
+++ b/sys/src/9/zynq/main.c
@@ -306,7 +306,7 @@ userinit(void)
s->flushme++;
p->seg[TSEG] = s;
pg = newpage(0, 0, UTZERO);
- memset(pg->cachectl, PG_TXTFLUSH, sizeof(pg->cachectl));
+ pg->txtflush = ~0;
segpage(s, pg);
v = tmpmap(pg->pa);
diff --git a/sys/src/9/zynq/mmu.c b/sys/src/9/zynq/mmu.c
index 54f6a17d6..66816225f 100644
--- a/sys/src/9/zynq/mmu.c
+++ b/sys/src/9/zynq/mmu.c
@@ -140,7 +140,6 @@ putmmu(uintptr va, uintptr pa, Page *pg)
ulong *e;
ulong *l2;
PTE old;
- char *ctl;
uintptr l2p;
int s;
@@ -180,11 +179,10 @@ putmmu(uintptr va, uintptr pa, Page *pg)
splx(s);
if((old & L2VALID) != 0)
flushpg((void *) va);
- ctl = &pg->cachectl[m->machno];
- if(*ctl == PG_TXTFLUSH){
+ if(pg->txtflush & (1<<m->machno)){
cleandse((void *) va, (void *) (va + BY2PG));
invalise((void *) va, (void *) (va + BY2PG));
- *ctl = PG_NOFLUSH;
+ pg->txtflush &= ~(1<<m->machno);
}
}