From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 11:17:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63BEF106566B; Tue, 21 Aug 2012 11:17:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 456768FC15; Tue, 21 Aug 2012 11:17:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7LBHCsh024475; Tue, 21 Aug 2012 11:17:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7LBHCo6024472; Tue, 21 Aug 2012 11:17:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201208211117.q7LBHCo6024472@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Aug 2012 11:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239491 - in releng/9.1/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 11:17:12 -0000 Author: marius Date: Tue Aug 21 11:17:11 2012 New Revision: 239491 URL: http://svn.freebsd.org/changeset/base/239491 Log: MFC: r239079 Merge r236494 from x86: Isolate the global TTE list lock from data and other locks to prevent false sharing within the cache. Approved by: re (kib) Modified: releng/9.1/sys/sparc64/include/pmap.h releng/9.1/sys/sparc64/sparc64/pmap.c Directory Properties: releng/9.1/sys/ (props changed) releng/9.1/sys/amd64/include/xen/ (props changed) releng/9.1/sys/boot/ (props changed) releng/9.1/sys/boot/i386/efi/ (props changed) releng/9.1/sys/boot/ia64/efi/ (props changed) releng/9.1/sys/boot/ia64/ski/ (props changed) releng/9.1/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.1/sys/boot/powerpc/ofw/ (props changed) releng/9.1/sys/cddl/contrib/opensolaris/ (props changed) releng/9.1/sys/conf/ (props changed) releng/9.1/sys/contrib/dev/acpica/ (props changed) releng/9.1/sys/contrib/octeon-sdk/ (props changed) releng/9.1/sys/contrib/pf/ (props changed) releng/9.1/sys/contrib/x86emu/ (props changed) releng/9.1/sys/dev/ (props changed) releng/9.1/sys/dev/e1000/ (props changed) releng/9.1/sys/dev/isp/ (props changed) releng/9.1/sys/dev/ixgbe/ (props changed) releng/9.1/sys/fs/ (props changed) releng/9.1/sys/fs/ntfs/ (props changed) releng/9.1/sys/modules/ (props changed) Modified: releng/9.1/sys/sparc64/include/pmap.h ============================================================================== --- releng/9.1/sys/sparc64/include/pmap.h Tue Aug 21 10:30:57 2012 (r239490) +++ releng/9.1/sys/sparc64/include/pmap.h Tue Aug 21 11:17:11 2012 (r239491) @@ -68,6 +68,11 @@ struct pmap { struct pmap_statistics pm_stats; }; +struct tte_list_lock { + struct rwlock lock; + char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; +}; + #define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) #define PMAP_LOCK_ASSERT(pmap, type) \ mtx_assert(&(pmap)->pm_mtx, (type)) @@ -102,7 +107,8 @@ void pmap_set_kctx(void); extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) -extern struct rwlock tte_list_global_lock; +extern struct tte_list_lock tte_list_global; +#define tte_list_global_lock tte_list_global.lock extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; Modified: releng/9.1/sys/sparc64/sparc64/pmap.c ============================================================================== --- releng/9.1/sys/sparc64/sparc64/pmap.c Tue Aug 21 10:30:57 2012 (r239490) +++ releng/9.1/sys/sparc64/sparc64/pmap.c Tue Aug 21 11:17:11 2012 (r239491) @@ -135,9 +135,11 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; /* - * Global tte list lock + * Isolate the global TTE list lock from data and other locks to prevent + * false sharing within the cache (see also the declaration of struct + * tte_list_lock). */ -struct rwlock tte_list_global_lock; +struct tte_list_lock tte_list_global __aligned(CACHE_LINE_SIZE); /* * Allocate physical memory for use in pmap_bootstrap. @@ -672,7 +674,7 @@ pmap_bootstrap(u_int cpu_impl) pm->pm_context[i] = TLB_CTX_KERNEL; CPU_FILL(&pm->pm_active); - /* + /* * Initialize the global tte list lock. */ rw_init(&tte_list_global_lock, "tte list global");