From owner-linux-origin@oss.sgi.com Fri Jun 15 17:57:45 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id f5G0vjB30960 for linux-origin-outgoing; Fri, 15 Jun 2001 17:57:45 -0700 Received: from dea.waldorf-gmbh.de (u-5-18.karlsruhe.ipdial.viaginterkom.de [62.180.18.5]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id f5G0vck30957 for ; Fri, 15 Jun 2001 17:57:38 -0700 Received: (from ralf@localhost) by dea.waldorf-gmbh.de (8.11.1/8.11.1) id f5G0vR119325; Sat, 16 Jun 2001 02:57:27 +0200 Date: Sat, 16 Jun 2001 02:57:27 +0200 From: Ralf Baechle To: John Hawkes Cc: linux-origin@oss.sgi.com Subject: Re: mips64 vm problems? Message-ID: <20010616025726.A19309@bacchus.dhis.org> References: <019901c0f5c6$be38d820$6401a8c0@marin1.sfba.home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <019901c0f5c6$be38d820$6401a8c0@marin1.sfba.home.com>; from hawkes@engr.sgi.com on Fri, Jun 15, 2001 at 11:12:30AM -0700 X-Accept-Language: de,en,fr Sender: owner-linux-origin@oss.sgi.com Precedence: bulk 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 #include #include +#include #include #include #include @@ -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);