From 9a3572cacb83757c50d505c29bb7a7a1b6d1d21a Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Tue, 11 Sep 2018 14:25:46 -0400 Subject: [PATCH] Remove chainbase mlock() The mlock code was effectively inactive until 1.2.4. Enabling it has caused some unexpected support fallout. Remove it for now until a better solution is implemented in the future; performance will effectively be no worse than pre 1.2.4 --- src/chainbase.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/chainbase.cpp b/src/chainbase.cpp index 945e375a55a..7e589a0f7ec 100644 --- a/src/chainbase.cpp +++ b/src/chainbase.cpp @@ -113,18 +113,6 @@ namespace chainbase { ) ); _segment->find_or_construct< environment_check >( "environment" )(); } - -#ifndef _WIN32 - if( mlock( _segment->get_address(), _segment->get_size() ) != 0 ) - { - //we cannot use fc library here, which means that this message doesn't go to graylog even if you have configure it - //also it doesn't looks as nice as warnings generated by fc - //this message is for 1.0.2 because failing here would be incompatibel with 1.0 - //for 1.1 it probably will be changed to throw an exception - std::cerr << "CHAINBASE: Failed to pin chainbase shared memory (of size " << (_segment->get_size() / (1024.0*1024.0)) - << " MB) in RAM. Performance degradation is possible." << std::endl; - } -#endif abs_path = bfs::absolute( dir / "shared_memory.meta" ); @@ -147,18 +135,6 @@ namespace chainbase { _rw_manager = _meta->find_or_construct< read_write_mutex_manager >( "rw_manager" )(); } -#ifndef _WIN32 - if( mlock( _meta->get_address(), _meta->get_size() ) != 0 ) - { - //we cannot use fc library here, which means that this message doesn't go to graylog even if you have configure it - //also it doesn't looks as nice as warnings generated by fc - //this message is for 1.0.2 because failing here would be incompatibel with 1.0 - //for 1.1 it probably will be changed to throw an exception - std::cerr << "CHAINBASE: Failed to pin chainbase metadata memory (of size " << _meta->get_size() - << " bytes) in RAM. Performance degradation is possible." << std::endl; - } -#endif - bool* db_is_dirty = nullptr; bool* meta_is_dirty = nullptr;