Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2012 09:10:15 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r239483 - in stable/9/sys/sparc64: include sparc64
Message-ID:  <201208210910.q7L9AFE1002198@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Tue Aug 21 09:10:14 2012
New Revision: 239483
URL: http://svn.freebsd.org/changeset/base/239483

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.

Modified:
  stable/9/sys/sparc64/include/pmap.h
  stable/9/sys/sparc64/sparc64/pmap.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/sparc64/include/pmap.h
==============================================================================
--- stable/9/sys/sparc64/include/pmap.h	Tue Aug 21 09:05:23 2012	(r239482)
+++ stable/9/sys/sparc64/include/pmap.h	Tue Aug 21 09:10:14 2012	(r239483)
@@ -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: stable/9/sys/sparc64/sparc64/pmap.c
==============================================================================
--- stable/9/sys/sparc64/sparc64/pmap.c	Tue Aug 21 09:05:23 2012	(r239482)
+++ stable/9/sys/sparc64/sparc64/pmap.c	Tue Aug 21 09:10:14 2012	(r239483)
@@ -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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208210910.q7L9AFE1002198>