Author: alc
Date: Sat Jun  2 22:14:10 2012
New Revision: 236494
URL: http://svn.freebsd.org/changeset/base/236494

Log:
  Isolate the global pv list lock from data and other locks to prevent false
  sharing within the cache.

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c Sat Jun  2 21:22:26 2012        (r236493)
+++ head/sys/amd64/amd64/pmap.c Sat Jun  2 22:14:10 2012        (r236494)
@@ -200,12 +200,22 @@ static u_int64_t  DMPDphys;       /* phys addr 
 static u_int64_t       DMPDPphys;      /* phys addr of direct mapped level 3 */
 
 /*
+ * Isolate the global pv list lock from data and other locks to prevent false
+ * sharing within the cache.
+ */
+static struct {
+       struct rwlock   lock;
+       char            padding[CACHE_LINE_SIZE - sizeof(struct rwlock)];
+} pvh_global __aligned(CACHE_LINE_SIZE);
+
+#define        pvh_global_lock pvh_global.lock
+
+/*
  * Data for the pv entry allocation mechanism
  */
 static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks);
 static long pv_entry_count;
 static struct md_page *pv_table;
-static struct rwlock pvh_global_lock;
 
 /*
  * All those kernel PT submaps that BSD is so fond of

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c   Sat Jun  2 21:22:26 2012        (r236493)
+++ head/sys/i386/i386/pmap.c   Sat Jun  2 22:14:10 2012        (r236494)
@@ -232,12 +232,22 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_ena
 static int pat_index[PAT_INDEX_SIZE];  /* cache mode to PAT index conversion */
 
 /*
+ * Isolate the global pv list lock from data and other locks to prevent false
+ * sharing within the cache.
+ */
+static struct {
+       struct rwlock   lock;
+       char            padding[CACHE_LINE_SIZE - sizeof(struct rwlock)];
+} pvh_global __aligned(CACHE_LINE_SIZE);
+
+#define        pvh_global_lock pvh_global.lock
+
+/*
  * Data for the pv entry allocation mechanism
  */
 static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks);
 static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0;
 static struct md_page *pv_table;
-static struct rwlock pvh_global_lock;
 static int shpgperproc = PMAP_SHPGPERPROC;
 
 struct pv_chunk *pv_chunkbase;         /* KVA block for pv_chunks */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to