From 18121a65baee8e6d183e35718322c538346404b2 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Thu, 23 Apr 2009 07:42:03 +0000 Subject: Make pmap_deactivate a NOP. Instead of keeping a bitmask of on which cpu the pmap might be active which we clear in pmap_deactivate, always keep a pointer to the currently loaded pmap in cpu_info. We can now optimize a context switch to the kernel pmap (idle and kernel threads) to keep the previously loaded pmap still loaded and then reuse that pmap if we context switch back to the same process. Introduce a new IPI to force a pmap reload before the pmap is destroyed. Clean up cpu_switchto. toby@ ok --- sys/arch/amd64/include/pmap.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/arch/amd64/include/pmap.h') diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h index 019aa2cfa59..94b4dfe0619 100644 --- a/sys/arch/amd64/include/pmap.h +++ b/sys/arch/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.21 2009/03/30 16:09:36 oga Exp $ */ +/* $OpenBSD: pmap.h,v 1.22 2009/04/23 07:42:02 art Exp $ */ /* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ /* @@ -325,7 +325,6 @@ struct pmap { union descriptor *pm_ldt; /* user-set LDT */ int pm_ldt_len; /* number of LDT entries */ int pm_ldt_sel; /* LDT selector */ - u_int32_t pm_cpus; /* mask of CPUs using pmap */ }; /* @@ -416,6 +415,8 @@ static void pmap_update_pg(vaddr_t); static void pmap_update_2pg(vaddr_t,vaddr_t); void pmap_write_protect(struct pmap *, vaddr_t, vaddr_t, vm_prot_t); +void pmap_switch(struct proc *, struct proc *); + vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */ @@ -423,8 +424,10 @@ void pmap_tlb_shootpage(struct pmap *, vaddr_t); void pmap_tlb_shootrange(struct pmap *, vaddr_t, vaddr_t); void pmap_tlb_shoottlb(void); #ifdef MULTIPROCESSOR +void pmap_tlb_droppmap(struct pmap *); void pmap_tlb_shootwait(void); #else +#define pmap_tlb_droppmap(pm) #define pmap_tlb_shootwait() #endif -- cgit v1.2.3