Date: Fri, 17 Mar 2006 06:04:58 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 93436 for review Message-ID: <200603170604.k2H64wQM045957@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93436 Change 93436 by kmacy@kmacy_storage:sun4v_work on 2006/03/17 06:04:41 optimize tsb_clear_range use in pmap_invalidate_range enable small mallocs from direct memory reference pcpu structures through direct mappings Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/vmparam.h#3 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/machdep.c#12 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#30 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/vmparam.h#3 (text+ko) ==== @@ -145,7 +145,7 @@ #define VM_MIN_PROM_ADDRESS (0x00000000f0000000UL) #define VM_MAX_PROM_ADDRESS (0x00000000ffffe000UL) -#define VM_MIN_USER_ADDRESS (0x0000000000000000UL) +#define VM_MIN_USER_ADDRESS (0x0000000000002000UL) #define VM_MAX_USER_ADDRESS (0x000007fe00000000UL) #define VM_MINUSER_ADDRESS (VM_MIN_USER_ADDRESS) @@ -176,10 +176,7 @@ #ifndef VM_INITIAL_PAGEIN #define VM_INITIAL_PAGEIN 16 #endif -#if 0 -/* does silly things */ #define UMA_MD_SMALL_ALLOC -#endif extern vm_offset_t vm_max_kernel_address; #endif /* !_MACHINE_VMPARAM_H_ */ ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/machdep.c#12 (text+ko) ==== @@ -404,7 +404,13 @@ (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; pc->pc_curpcb = thread0.td_pcb; - + /* + * Update PCPU_REG to point to direct address + * to support easy phys <-> virt translation in trap handler + */ + pc = (struct pcpu *)TLB_PHYS_TO_DIRECT(vtophys(pc)); + cpu_setregs(pc); + /* * Initialize tunables. */ ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#30 (text+ko) ==== @@ -139,6 +139,7 @@ * invalidate more than this */ #define MAX_INVALIDATES 32 +#define MAX_TSB_CLEARS 128 /* * Allocate physical memory for use in pmap_bootstrap. @@ -1068,7 +1069,11 @@ DPRINTF("pmap_invalidate_range(sva=%lx, eva=%lx)\n", sva, eva); /* XXX SUN4V_FIXME - oversimplified logic */ - tsb_clear_range(&pmap->pm_tsb, sva, eva); + if ((((eva - sva) >> PAGE_SHIFT) < MAX_TSB_CLEARS) || + (pmap->pm_context == 0)) + tsb_clear_range(&pmap->pm_tsb, sva, eva); + else + tsb_clear(&pmap->pm_tsb); if ((((eva - sva) >> PAGE_SHIFT) < MAX_INVALIDATES)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603170604.k2H64wQM045957>