Commit 34faeb0a authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5672 #5742 suppress race we know about on size_current/size_evicting,...

refs #5672 #5742 suppress race we know about on size_current/size_evicting, suppress more warnings from that helgrind bug

git-svn-id: file:///svn/toku/tokudb@50725 c7de825b-a66e-492c-adef-691d508d4ae1
parent cfc54094
...@@ -400,7 +400,12 @@ class evictor { ...@@ -400,7 +400,12 @@ class evictor {
void decrease_size_evicting(long size_evicting_estimate); void decrease_size_evicting(long size_evicting_estimate);
bool should_sleeping_clients_wakeup(); bool should_sleeping_clients_wakeup();
bool eviction_needed(); bool eviction_needed();
// We have some intentional races with these variables because we're ok with reading something a little bit old.
// Provide some hooks for reading variables in an unsafe way so that there are function names we can stick in a valgrind suppression.
int64_t unsafe_read_size_current(void) const;
int64_t unsafe_read_size_evicting(void) const;
pair_list* m_pl; pair_list* m_pl;
int64_t m_size_current; // the sum of the sizes of the pairs in the cachetable int64_t m_size_current; // the sum of the sizes of the pairs in the cachetable
// changes to these two values are protected // changes to these two values are protected
......
...@@ -3453,8 +3453,6 @@ static void *eviction_thread(void *evictor_v) { ...@@ -3453,8 +3453,6 @@ static void *eviction_thread(void *evictor_v) {
// //
void evictor::init(long _size_limit, pair_list* _pl, KIBBUTZ _kibbutz, uint32_t eviction_period) { void evictor::init(long _size_limit, pair_list* _pl, KIBBUTZ _kibbutz, uint32_t eviction_period) {
TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_ev_thread_is_running, sizeof m_ev_thread_is_running); TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_ev_thread_is_running, sizeof m_ev_thread_is_running);
TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_size_current, sizeof m_size_current);
TOKU_VALGRIND_HG_DISABLE_CHECKING(&m_size_evicting, sizeof m_size_evicting);
m_low_size_watermark = _size_limit; m_low_size_watermark = _size_limit;
// these values are selected kind of arbitrarily right now as // these values are selected kind of arbitrarily right now as
...@@ -3984,7 +3982,7 @@ void evictor::signal_eviction_thread() { ...@@ -3984,7 +3982,7 @@ void evictor::signal_eviction_thread() {
// the values may be a little off, but we think that is tolerable. // the values may be a little off, but we think that is tolerable.
// //
bool evictor::should_client_thread_sleep(){ bool evictor::should_client_thread_sleep(){
return m_size_current > m_high_size_watermark; return unsafe_read_size_current() > m_high_size_watermark;
} }
// //
...@@ -3996,7 +3994,7 @@ bool evictor::should_client_thread_sleep(){ ...@@ -3996,7 +3994,7 @@ bool evictor::should_client_thread_sleep(){
// the values may be a little off, but we think that is tolerable. // the values may be a little off, but we think that is tolerable.
// //
bool evictor::should_sleeping_clients_wakeup() { bool evictor::should_sleeping_clients_wakeup() {
return m_size_current <= m_high_size_hysteresis; return unsafe_read_size_current() <= m_high_size_hysteresis;
} }
// //
...@@ -4012,9 +4010,9 @@ bool evictor::should_sleeping_clients_wakeup() { ...@@ -4012,9 +4010,9 @@ bool evictor::should_sleeping_clients_wakeup() {
// calling this function. // calling this function.
// //
bool evictor::should_client_wake_eviction_thread() { bool evictor::should_client_wake_eviction_thread() {
return return
!m_ev_thread_is_running && !m_ev_thread_is_running &&
((m_size_current - m_size_evicting) > m_low_size_hysteresis); ((unsafe_read_size_current() - unsafe_read_size_evicting()) > m_low_size_hysteresis);
} }
// //
...@@ -4026,6 +4024,15 @@ bool evictor::eviction_needed() { ...@@ -4026,6 +4024,15 @@ bool evictor::eviction_needed() {
return (m_size_current - m_size_evicting) > m_low_size_watermark; return (m_size_current - m_size_evicting) > m_low_size_watermark;
} }
inline int64_t evictor::unsafe_read_size_current(void) const {
return m_size_current;
}
inline int64_t evictor::unsafe_read_size_evicting(void) const {
return m_size_evicting;
}
void evictor::fill_engine_status() { void evictor::fill_engine_status() {
STATUS_VALUE(CT_SIZE_CURRENT) = m_size_current; STATUS_VALUE(CT_SIZE_CURRENT) = m_size_current;
STATUS_VALUE(CT_SIZE_LIMIT) = m_low_size_hysteresis; STATUS_VALUE(CT_SIZE_LIMIT) = m_low_size_hysteresis;
......
...@@ -89,3 +89,13 @@ ...@@ -89,3 +89,13 @@
drd:ConflictingAccess drd:ConflictingAccess
fun:_ZNK4toku8locktree46unsafe_read_single_txnid_optimization_possibleEv fun:_ZNK4toku8locktree46unsafe_read_single_txnid_optimization_possibleEv
} }
{
unsafe_read_size_evicting
drd:ConflictingAccess
fun:_ZNK7evictor25unsafe_read_size_evictingEv
}
{
unsafe_read_size_current
drd:ConflictingAccess
fun:_ZNK7evictor24unsafe_read_size_currentEv
}
...@@ -40,20 +40,20 @@ ...@@ -40,20 +40,20 @@
fun:_ZNK4toku8locktree46unsafe_read_single_txnid_optimization_possibleEv fun:_ZNK4toku8locktree46unsafe_read_single_txnid_optimization_possibleEv
} }
{ {
kde_bug_307082_cond_destroy_without_signal unsafe_read_size_evicting
Helgrind:Misc Helgrind:Race
... fun:_ZNK7evictor25unsafe_read_size_evictingEv
fun:pthread_cond_destroy@* }
fun:_ZL17toku_cond_destroyP9toku_cond {
fun:_ZN4toku12lock_request7destroyEv unsafe_read_size_current
fun:_Z22toku_db_get_range_lockP9__toku_dbP13__toku_db_txnPK10__toku_dbtS5_N4toku12lock_request4typeE Helgrind:Race
fun:_ZNK7evictor24unsafe_read_size_currentEv
} }
{ {
kde_bug_307082_cond_destroy_without_signal kde_bug_307082_cond_destroy_without_signal
Helgrind:Misc Helgrind:Misc
... ...
fun:pthread_cond_destroy@* fun:pthread_cond_destroy@*
fun:_ZL17toku_cond_destroyP9toku_cond
... ...
fun:_ZL14ctpair_destroyP6ctpair fun:_ZL14ctpair_destroyP6ctpair
} }
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
Helgrind:Misc Helgrind:Misc
... ...
fun:pthread_cond_destroy@* fun:pthread_cond_destroy@*
fun:_ZL17toku_cond_destroyP9toku_cond ...
fun:_ZL14rwlock_destroyP6rwlock fun:_ZL14rwlock_destroyP6rwlock
fun:_ZL16nb_mutex_destroyP8nb_mutex fun:_ZL16nb_mutex_destroyP8nb_mutex
fun:_Z23toku_blocktable_destroyPP11block_table fun:_Z23toku_blocktable_destroyPP11block_table
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
Helgrind:Misc Helgrind:Misc
... ...
fun:pthread_cond_destroy@* fun:pthread_cond_destroy@*
fun:_ZL17toku_cond_destroyP9toku_cond ...
fun:_Z11bjm_destroyP29background_job_manager_struct fun:_Z11bjm_destroyP29background_job_manager_struct
} }
{ {
...@@ -80,28 +80,23 @@ ...@@ -80,28 +80,23 @@
Helgrind:Misc Helgrind:Misc
... ...
fun:pthread_cond_destroy@* fun:pthread_cond_destroy@*
fun:_ZL17toku_cond_destroyP9toku_cond ...
fun:_Z24toku_txn_manager_destroyP11txn_manager fun:_Z24toku_txn_manager_destroyP11txn_manager
fun:_Z17toku_logger_closePP10tokulogger
} }
{ {
kde_bug_307082_cond_destroy_without_signal kde_bug_307082_cond_destroy_without_signal
Helgrind:Misc Helgrind:Misc
... ...
fun:pthread_cond_destroy@* fun:pthread_cond_destroy@*
fun:_ZL17toku_cond_destroyP9toku_cond ...
fun:_Z24toku_thread_pool_destroyPP16toku_thread_pool fun:_Z24toku_thread_pool_destroyPP16toku_thread_pool
fun:_Z31toku_ft_serialize_layer_destroyv
fun:_Z21toku_ft_layer_destroyv
fun:_Z16toku_ydb_destroyv
fun:_ZL17libtokudb_destroyv
} }
{ {
kde_bug_307082_cond_destroy_without_signal kde_bug_307082_cond_destroy_without_signal
Helgrind:Misc Helgrind:Misc
... ...
fun:pthread_cond_destroy@* fun:pthread_cond_destroy@*
fun:_ZL17toku_cond_destroyP9toku_cond ...
fun:_Z22toku_minicron_shutdownP8minicron fun:_Z22toku_minicron_shutdownP8minicron
} }
{ {
...@@ -109,7 +104,7 @@ ...@@ -109,7 +104,7 @@
Helgrind:Misc Helgrind:Misc
... ...
fun:pthread_cond_destroy@* fun:pthread_cond_destroy@*
fun:_ZL17toku_cond_destroyP9toku_cond ...
fun:_ZN4toku12lock_request7destroyEv fun:_ZN4toku12lock_request7destroyEv
} }
{ {
...@@ -117,6 +112,6 @@ ...@@ -117,6 +112,6 @@
Helgrind:Misc Helgrind:Misc
... ...
fun:pthread_cond_destroy@* fun:pthread_cond_destroy@*
fun:_ZL17toku_cond_destroyP9toku_cond ...
fun:_Z17toku_logger_closePP10tokulogger fun:_Z17toku_logger_closePP10tokulogger
} }
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