From owner-p4-projects@FreeBSD.ORG Fri Mar 17 06:04:59 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DB2EC16A420; Fri, 17 Mar 2006 06:04:58 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D98416A401 for ; Fri, 17 Mar 2006 06:04:58 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E34443D46 for ; Fri, 17 Mar 2006 06:04:58 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2H64w98045960 for ; Fri, 17 Mar 2006 06:04:58 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2H64wQM045957 for perforce@freebsd.org; Fri, 17 Mar 2006 06:04:58 GMT (envelope-from kmacy@freebsd.org) Date: Fri, 17 Mar 2006 06:04:58 GMT Message-Id: <200603170604.k2H64wQM045957@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 93436 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Mar 2006 06:04:59 -0000 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)) {