libitm: Put gl_wt global lock on separate cache line.
authorTorvald Riegel <triegel@redhat.com>
Mon, 20 Feb 2012 20:57:37 +0000 (20:57 +0000)
committerTorvald Riegel <torvald@gcc.gnu.org>
Mon, 20 Feb 2012 20:57:37 +0000 (20:57 +0000)
libitm/
* method-gl.cc (gl_wt_dispatch::orec): Put on separate cacheline.

From-SVN: r184403

libitm/ChangeLog
libitm/method-gl.cc

index da94906..2676cbe 100644 (file)
@@ -1,5 +1,9 @@
 2012-02-20  Torvald Riegel  <triegel@redhat.com>
 
+       * method-gl.cc (gl_wt_dispatch::orec): Put on separate cacheline.
+
+2012-02-20  Torvald Riegel  <triegel@redhat.com>
+
        * method-gl.cc (gl_wt_dispatch::rollback): Optimize memory orders.
 
 2012-02-20  Torvald Riegel  <triegel@redhat.com>
index 4fd506e..4b6769b 100644 (file)
@@ -41,7 +41,8 @@ struct gl_mg : public method_group
   static gtm_word clear_locked(gtm_word l) { return l & ~LOCK_BIT; }
 
   // The global ownership record.
-  atomic<gtm_word> orec;
+  // No tail-padding necessary (the virtual functions aren't used frequently).
+  atomic<gtm_word> orec __attribute__((aligned(HW_CACHELINE_SIZE)));
 
   virtual void init()
   {
@@ -52,7 +53,6 @@ struct gl_mg : public method_group
   virtual void fini() { }
 };
 
-// TODO cacheline padding
 static gl_mg o_gl_mg;