Commit 31772c95 by Torvald Riegel Committed by Torvald Riegel

libitm: Add multi-lock, write-through TM method.

	libitm/
	* libitm_i.h (GTM::gtm_rwlog_entry): New.
	(GTM::gtm_thread): Add read and write logs.
	(GTM::dispatch_ml_wt): Declare.
	* retry.cc (parse_default_method): Support ml_wt.
	* method-ml.cc: New file.
	* Makefile.am: Add method-ml.cc.
	* Makefile.in: Regenerate.

From-SVN: r184212
parent 5b9cf5d2
2012-02-14 Torvald Riegel <triegel@redhat.com> 2012-02-14 Torvald Riegel <triegel@redhat.com>
* libitm_i.h (GTM::gtm_rwlog_entry): New.
(GTM::gtm_thread): Add read and write logs.
(GTM::dispatch_ml_wt): Declare.
* retry.cc (parse_default_method): Support ml_wt.
* method-ml.cc: New file.
* Makefile.am: Add method-ml.cc.
* Makefile.in: Regenerate.
2012-02-14 Torvald Riegel <triegel@redhat.com>
* dispatch.h (GTM::abi_dispatch::supports): New. * dispatch.h (GTM::abi_dispatch::supports): New.
(GTM::method_group::reinit): New. (GTM::method_group::reinit): New.
* retry.cc (GTM::gtm_thread::decide_retry_strategy): Use reinit(). * retry.cc (GTM::gtm_thread::decide_retry_strategy): Use reinit().
......
...@@ -60,7 +60,7 @@ libitm_la_SOURCES = \ ...@@ -60,7 +60,7 @@ libitm_la_SOURCES = \
aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc barrier.cc beginend.cc \ aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc barrier.cc beginend.cc \
clone.cc eh_cpp.cc local.cc \ clone.cc eh_cpp.cc local.cc \
query.cc retry.cc rwlock.cc useraction.cc util.cc \ query.cc retry.cc rwlock.cc useraction.cc util.cc \
sjlj.S tls.cc method-serial.cc method-gl.cc sjlj.S tls.cc method-serial.cc method-gl.cc method-ml.cc
if ARCH_ARM if ARCH_ARM
libitm_la_SOURCES += hwcap.cc libitm_la_SOURCES += hwcap.cc
......
...@@ -100,15 +100,15 @@ libitm_la_LIBADD = ...@@ -100,15 +100,15 @@ libitm_la_LIBADD =
am__libitm_la_SOURCES_DIST = aatree.cc alloc.cc alloc_c.cc \ am__libitm_la_SOURCES_DIST = aatree.cc alloc.cc alloc_c.cc \
alloc_cpp.cc barrier.cc beginend.cc clone.cc eh_cpp.cc \ alloc_cpp.cc barrier.cc beginend.cc clone.cc eh_cpp.cc \
local.cc query.cc retry.cc rwlock.cc useraction.cc util.cc \ local.cc query.cc retry.cc rwlock.cc useraction.cc util.cc \
sjlj.S tls.cc method-serial.cc method-gl.cc hwcap.cc \ sjlj.S tls.cc method-serial.cc method-gl.cc method-ml.cc \
x86_sse.cc x86_avx.cc futex.cc hwcap.cc x86_sse.cc x86_avx.cc futex.cc
@ARCH_ARM_TRUE@am__objects_1 = hwcap.lo @ARCH_ARM_TRUE@am__objects_1 = hwcap.lo
@ARCH_X86_TRUE@am__objects_2 = x86_sse.lo x86_avx.lo @ARCH_X86_TRUE@am__objects_2 = x86_sse.lo x86_avx.lo
@ARCH_FUTEX_TRUE@am__objects_3 = futex.lo @ARCH_FUTEX_TRUE@am__objects_3 = futex.lo
am_libitm_la_OBJECTS = aatree.lo alloc.lo alloc_c.lo alloc_cpp.lo \ am_libitm_la_OBJECTS = aatree.lo alloc.lo alloc_c.lo alloc_cpp.lo \
barrier.lo beginend.lo clone.lo eh_cpp.lo local.lo query.lo \ barrier.lo beginend.lo clone.lo eh_cpp.lo local.lo query.lo \
retry.lo rwlock.lo useraction.lo util.lo sjlj.lo tls.lo \ retry.lo rwlock.lo useraction.lo util.lo sjlj.lo tls.lo \
method-serial.lo method-gl.lo $(am__objects_1) \ method-serial.lo method-gl.lo method-ml.lo $(am__objects_1) \
$(am__objects_2) $(am__objects_3) $(am__objects_2) $(am__objects_3)
libitm_la_OBJECTS = $(am_libitm_la_OBJECTS) libitm_la_OBJECTS = $(am_libitm_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ DEFAULT_INCLUDES = -I.@am__isrc@
...@@ -379,8 +379,8 @@ libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) ...@@ -379,8 +379,8 @@ libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script)
libitm_la_SOURCES = aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc \ libitm_la_SOURCES = aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc \
barrier.cc beginend.cc clone.cc eh_cpp.cc local.cc query.cc \ barrier.cc beginend.cc clone.cc eh_cpp.cc local.cc query.cc \
retry.cc rwlock.cc useraction.cc util.cc sjlj.S tls.cc \ retry.cc rwlock.cc useraction.cc util.cc sjlj.S tls.cc \
method-serial.cc method-gl.cc $(am__append_1) $(am__append_2) \ method-serial.cc method-gl.cc method-ml.cc $(am__append_1) \
$(am__append_3) $(am__append_2) $(am__append_3)
# Automake Documentation: # Automake Documentation:
# If your package has Texinfo files in many directories, you can use the # If your package has Texinfo files in many directories, you can use the
...@@ -512,6 +512,7 @@ distclean-compile: ...@@ -512,6 +512,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hwcap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hwcap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/method-gl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/method-gl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/method-ml.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/method-serial.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/method-serial.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retry.Plo@am__quote@
......
...@@ -145,6 +145,13 @@ struct gtm_undolog ...@@ -145,6 +145,13 @@ struct gtm_undolog
void rollback (gtm_thread* tx, size_t until_size = 0); void rollback (gtm_thread* tx, size_t until_size = 0);
}; };
// An entry of a read or write log. Used by multi-lock TM methods.
struct gtm_rwlog_entry
{
atomic<gtm_word> *orec;
gtm_word value;
};
// Contains all thread-specific data required by the entire library. // Contains all thread-specific data required by the entire library.
// This includes all data relevant to a single transaction. Because most // This includes all data relevant to a single transaction. Because most
// thread-specific data is about the current transaction, we also refer to // thread-specific data is about the current transaction, we also refer to
...@@ -174,6 +181,10 @@ struct gtm_thread ...@@ -174,6 +181,10 @@ struct gtm_thread
// Data used by local.c for the undo log for both local and shared memory. // Data used by local.c for the undo log for both local and shared memory.
gtm_undolog undolog; gtm_undolog undolog;
// Read and write logs. Used by multi-lock TM methods.
vector<gtm_rwlog_entry> readlog;
vector<gtm_rwlog_entry> writelog;
// Data used by alloc.c for the malloc/free undo log. // Data used by alloc.c for the malloc/free undo log.
aa_tree<uintptr_t, gtm_alloc_action> alloc_actions; aa_tree<uintptr_t, gtm_alloc_action> alloc_actions;
...@@ -320,6 +331,7 @@ extern abi_dispatch *dispatch_serial(); ...@@ -320,6 +331,7 @@ extern abi_dispatch *dispatch_serial();
extern abi_dispatch *dispatch_serialirr(); extern abi_dispatch *dispatch_serialirr();
extern abi_dispatch *dispatch_serialirr_onwrite(); extern abi_dispatch *dispatch_serialirr_onwrite();
extern abi_dispatch *dispatch_gl_wt(); extern abi_dispatch *dispatch_gl_wt();
extern abi_dispatch *dispatch_ml_wt();
extern gtm_cacheline_mask gtm_mask_stack(gtm_cacheline *, gtm_cacheline_mask); extern gtm_cacheline_mask gtm_mask_stack(gtm_cacheline *, gtm_cacheline_mask);
......
...@@ -199,6 +199,11 @@ parse_default_method() ...@@ -199,6 +199,11 @@ parse_default_method()
disp = GTM::dispatch_gl_wt(); disp = GTM::dispatch_gl_wt();
env += 5; env += 5;
} }
else if (strncmp(env, "ml_wt", 5) == 0)
{
disp = GTM::dispatch_ml_wt();
env += 5;
}
else else
goto unknown; goto unknown;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment