On Fri, Jun 15, 2001 at 11:12:30AM -0700, John Hawkes wrote:
> Do you understand the nature of the mips64 vm problems? Do you have any
> idea how long it will take to fix?
Exactly that long. I found that vmalloc was already broken before the
recent changes which finally broke it in obvious ways.
Btw, I'm interested in the results of your research about the mips64 kernel,
that is where are problems with locking, how does it compare in performance
to Linux on other architectures etc.
Ralf
Index: linux/arch/mips64/kernel/r4k_tlb.S
diff -u linux/arch/mips64/kernel/r4k_tlb.S:1.4
linux/arch/mips64/kernel/r4k_tlb.S:1.5
--- linux/arch/mips64/kernel/r4k_tlb.S:1.4 Fri Feb 23 11:23:51 2001
+++ linux/arch/mips64/kernel/r4k_tlb.S Sat Jun 16 02:43:08 2001
@@ -96,9 +96,6 @@
*/
dmfc0 k0, CP0_BADVADDR
dli k1, VMALLOC_START
- sltu k1, k0, k1
- bne k1, zero, not_vmalloc
- dli k1, VMALLOC_START
/*
* Now find offset into kptbl.
@@ -114,20 +111,16 @@
*/
dla k0, ekptbl
sltu k0, k1, k0
- beq k0, zero, not_vmalloc
+ beqz k0, not_vmalloc
/*
* Load cp0 registers.
*/
ld k0, 0(k1) # get even pte
ld k1, 8(k1) # get odd pte
-1:
+
+not_vmalloc:
PTE_RELOAD k0 k1
nop
tlbwr
eret
-not_vmalloc:
- daddu k0, zero, zero
- daddu k1, zero, zero
- j 1b
- nop
Index: linux/arch/mips64/mm/fault.c
diff -u linux/arch/mips64/mm/fault.c:1.17 linux/arch/mips64/mm/fault.c:1.18
--- linux/arch/mips64/mm/fault.c:1.17 Thu May 31 17:21:21 2001
+++ linux/arch/mips64/mm/fault.c Sat Jun 16 02:44:40 2001
@@ -242,31 +242,5 @@
return;
vmalloc_fault:
- {
- /*
- * Synchronize this task's top level page-table
- * with the 'reference' page table.
- */
- int offset = pgd_index(address);
- pgd_t *pgd, *pgd_k;
- pmd_t *pmd, *pmd_k;
-
- pgd = tsk->active_mm->pgd + offset;
- pgd_k = init_mm.pgd + offset;
-
- if (!pgd_present(*pgd)) {
- if (!pgd_present(*pgd_k))
- goto bad_area_nosemaphore;
- set_pgd(pgd, *pgd_k);
- return;
- }
-
- pmd = pmd_offset(pgd, address);
- pmd_k = pmd_offset(pgd_k, address);
-
- if (pmd_present(*pmd) || !pmd_present(*pmd_k))
- goto bad_area_nosemaphore;
- set_pmd(pmd, *pmd_k);
- return;
- }
+ panic("Pagefault for kernel virtual memory");
}
Index: linux/arch/mips64/sgi-ip27/ip27-memory.c
diff -u linux/arch/mips64/sgi-ip27/ip27-memory.c:1.14
linux/arch/mips64/sgi-ip27/ip27-memory.c:1.15
--- linux/arch/mips64/sgi-ip27/ip27-memory.c:1.14 Thu Apr 5 05:35:18 2001
+++ linux/arch/mips64/sgi-ip27/ip27-memory.c Sat Jun 16 02:45:44 2001
@@ -20,6 +20,7 @@
#include <asm/bootinfo.h>
#include <asm/addrspace.h>
#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
#include <asm/sn/types.h>
#include <asm/sn/addrs.h>
#include <asm/sn/klconfig.h>
@@ -227,13 +228,24 @@
void __init paging_init(void)
{
+ pmd_t *pmd = kpmdtbl;
+ pte_t *pte = kptbl;
+
cnodeid_t node;
unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
+ int i;
/* Initialize the entire pgd. */
pgd_init((unsigned long)swapper_pg_dir);
pmd_init((unsigned long)invalid_pmd_table, (unsigned
long)invalid_pte_table);
memset((void *)invalid_pte_table, 0, sizeof(pte_t) * PTRS_PER_PTE);
+
+ /* This is for vmalloc */
+ memset((void *)kptbl, 0, PAGE_SIZE << KPTBL_PAGE_ORDER);
+ memset((void *)kpmdtbl, 0, PAGE_SIZE);
+ pgd_set(swapper_pg_dir, kpmdtbl);
+ for (i = 0; i < (1 << KPTBL_PAGE_ORDER); pmd++,i++,pte+=PTRS_PER_PTE)
+ pmd_val(*pmd) = (unsigned long)pte;
for (node = 0; node < numnodes; node++) {
pfn_t start_pfn = slot_getbasepfn(node, 0);
|