aboutsummaryrefslogtreecommitdiff
path: root/libitm
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2012-02-20 20:57:37 +0000
committerTorvald Riegel <torvald@gcc.gnu.org>2012-02-20 20:57:37 +0000
commit63b08143d6c6f74ce8ed3f5a83adc070cddc8e6b (patch)
tree87a8776bc7c37b9d5e9d359ce9f31a2baa2d94d0 /libitm
parent4c9bd6acb08cddb66a54e37cf5edb3c1d0348151 (diff)
downloadgcc-63b08143d6c6f74ce8ed3f5a83adc070cddc8e6b.zip
gcc-63b08143d6c6f74ce8ed3f5a83adc070cddc8e6b.tar.gz
gcc-63b08143d6c6f74ce8ed3f5a83adc070cddc8e6b.tar.bz2
libitm: Put gl_wt global lock on separate cache line.
libitm/ * method-gl.cc (gl_wt_dispatch::orec): Put on separate cacheline. From-SVN: r184403
Diffstat (limited to 'libitm')
-rw-r--r--libitm/ChangeLog4
-rw-r--r--libitm/method-gl.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index da94906..2676cbe 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -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>
diff --git a/libitm/method-gl.cc b/libitm/method-gl.cc
index 4fd506e..4b6769b 100644
--- a/libitm/method-gl.cc
+++ b/libitm/method-gl.cc
@@ -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;