From 11f30bb0e4bf666229b6b236cd3e4ed1de13283a Mon Sep 17 00:00:00 2001 From: Torvald Riegel Date: Sun, 8 Jan 2012 14:13:49 +0000 Subject: libitm: Optimize undo log. libitm/ * local.cc (GTM_LB): Use GTM::gtm_undolog. (GTM::gtm_thread::drop_references_undolog): Remove. (GTM::gtm_thread::commit_undolog, GTM::gtm_thread::rollback_undolog): Move to ... * libitm_i.h (GTM::gtm_undolog): ...here. New. (GTM::gtm_undolog_entry): Remove. (GTM::gtm_thread): Adapt. * beginend.cc (GTM::gtm_thread::rollback): Adapt. (GTM::gtm_thread::trycommit): Adapt. * method-serial.cc (serial_dispatch::log): Adapt. * method-gl.cc (gl_wt_dispatch::pre_write): Adapt. (gl_wt_dispatch::store): Fix likely/unlikely. * containers.h (GTM::vector::resize): Add additional_capacity parameter and handle it. (GTM::vector::resize_noinline): New/adapt. (GTM::vector::push): New. From-SVN: r182992 --- libitm/method-gl.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libitm/method-gl.cc') diff --git a/libitm/method-gl.cc b/libitm/method-gl.cc index e678da7..d6d050d 100644 --- a/libitm/method-gl.cc +++ b/libitm/method-gl.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Free Software Foundation, Inc. +/* Copyright (C) 2011, 2012 Free Software Foundation, Inc. Contributed by Torvald Riegel . This file is part of the GNU Transactional Memory Library (libitm). @@ -120,8 +120,7 @@ protected: tx->shared_state.store(gl_mg::set_locked(now), memory_order_release); } - // TODO Ensure that this gets inlined: Use internal log interface and LTO. - GTM_LB(addr, len); + tx->undolog.log(addr, len); } static void validate() @@ -181,7 +180,7 @@ protected: template static void store(V* addr, const V value, ls_modifier mod) { - if (unlikely(mod != WaW)) + if (likely(mod != WaW)) pre_write(addr, sizeof(V)); // FIXME We would need an atomic store here but we can't just forge an // atomic load for nonatomic data because this might not work on all -- cgit v1.1