summaryrefslogtreecommitdiff
path: root/libitm
diff options
context:
space:
mode:
authortorvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-20 20:57:37 +0000
committertorvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-20 20:57:37 +0000
commit3d2156136d019741015b677b8ad68dafd013143c (patch)
tree87a8776bc7c37b9d5e9d359ce9f31a2baa2d94d0 /libitm
parent625ff7f1b91264c832b07100f8a48791255d9f1d (diff)
downloadgcc-3d2156136d019741015b677b8ad68dafd013143c.tar.gz
libitm: Put gl_wt global lock on separate cache line.
libitm/ * method-gl.cc (gl_wt_dispatch::orec): Put on separate cacheline. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184403 138bc75d-0d04-0410-961f-82ee72b054a4
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 da94906bcd3..2676cbef4b0 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 4fd506ef154..4b6769ba2c0 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;