diff options
author | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-04-24 18:27:37 +0000 |
---|---|---|
committer | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-04-24 18:27:37 +0000 |
commit | b300fe5b8a34b50493217d022bf3830d64d74656 (patch) | |
tree | f6108c3e5dde7e359aa29a9abe430ba766afa359 /include/asm-mips64 | |
parent | 2bba74b71906107e5bce42b542b862f90cf048b3 (diff) |
Fix the init_new_context code not to zap the percpu tlbpid array when
doing a clone-vm operation. Also, the intercpu tlbflush code now properly
does its job by flushing the tlbpid only on the current processor, and
not on all.
Diffstat (limited to 'include/asm-mips64')
-rw-r--r-- | include/asm-mips64/mmu_context.h | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/include/asm-mips64/mmu_context.h b/include/asm-mips64/mmu_context.h index 578c782d6..eeb8d9091 100644 --- a/include/asm-mips64/mmu_context.h +++ b/include/asm-mips64/mmu_context.h @@ -51,15 +51,6 @@ get_new_cpu_mmu_context(struct mm_struct *mm, unsigned long cpu) CPU_CONTEXT(cpu, mm) = ASID_CACHE(cpu) = asid; } -extern inline void -get_new_mmu_context(struct mm_struct *mm) -{ -#ifdef CONFIG_SMP - memset((void *)mm->context, 0, smp_num_cpus * sizeof(unsigned long)); -#endif - get_new_cpu_mmu_context(mm, smp_processor_id()); -} - /* * Initialize the context related info for a new mm_struct * instance. @@ -70,18 +61,20 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) #ifndef CONFIG_SMP mm->context = 0; #else - /* this allocation can be moved to copy_thread */ - mm->context = (unsigned long)kmalloc(smp_num_cpus * + /* Make sure not to do anything during a clone-vm operation */ + if ((current == tsk) || (current->mm != mm)) { + mm->context = (unsigned long)kmalloc(smp_num_cpus * sizeof(unsigned long), GFP_KERNEL); - /* - * Init the "context" values so that a tlbpid allocation - * happens on the first switch. - */ - if (mm->context) - memset((void *)mm->context, 0, smp_num_cpus * + /* + * Init the "context" values so that a tlbpid allocation + * happens on the first switch. + */ + if (mm->context) + memset((void *)mm->context, 0, smp_num_cpus * sizeof(unsigned long)); - else - printk("Warning: init_new_context failed\n"); + else + printk("Warning: init_new_context failed\n"); + } #endif } |