diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-02-07 02:52:23 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-02-07 02:52:23 +0100 |
commit | b8cf3cb879a19c001796329ebe266104d13e63be (patch) | |
tree | 745534899e603d5336347c846ad286c3535c43fc /sys/src/9/teg2 | |
parent | f215b660b30cc5e5d318922f545441b4ac14b200 (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/teg2')
-rw-r--r-- | sys/src/9/teg2/main.c | 2 | ||||
-rw-r--r-- | sys/src/9/teg2/mmu.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/sys/src/9/teg2/main.c b/sys/src/9/teg2/main.c index 7b6aa92b1..c8e511d19 100644 --- a/sys/src/9/teg2/main.c +++ b/sys/src/9/teg2/main.c @@ -792,7 +792,7 @@ userinit(void) s = newseg(SG_TEXT, UTZERO, 1); p->seg[TSEG] = s; pg = newpage(1, 0, UTZERO); - memset(pg->cachectl, PG_TXTFLUSH, sizeof(pg->cachectl)); + pg->txtflush = ~0; segpage(s, pg); k = kmap(s->map[0]->pages[0]); memmove(UINT2PTR(VA(k)), initcode, sizeof initcode); diff --git a/sys/src/9/teg2/mmu.c b/sys/src/9/teg2/mmu.c index 19065fd6a..de6c819b8 100644 --- a/sys/src/9/teg2/mmu.c +++ b/sys/src/9/teg2/mmu.c @@ -582,10 +582,9 @@ putmmu(uintptr va, uintptr pa, Page* page) */ l1cache->wb(); - if(page->cachectl[0] == PG_TXTFLUSH){ - /* pio() sets PG_TXTFLUSH whenever a text pg has been written */ + if(page->txtflush & (1<<m->machno)){ cacheiinv(); - page->cachectl[0] = PG_NOFLUSH; + page->txtflush &= ~(1<<m->machno); } if (Debug) iprint("putmmu %#p %#p %#p\n", va, pa, PPN(pa)|x); |