Change the value of HashTable::defaultNumLocks from 193 to 47. Note
this is a no-op in a ns_server-controlled configutation as it already
explicilty sets the number of ht_locks to 47; therefore the only time
193 is used is in unit tests.
The reason for changing to 47 is to simplify testing - (1) we should
ideally test in a configuration as close to the "full" system, and (2)
we actually need to reduce the number of locks to <64 so we can run
successfully under ThreadSanitizer.
Change-Id: I1bcecc86cc90fbac215b8ee231179bee5d8cca32
Reviewed-on: http://review.couchbase.org/77889
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: James Harrison <james.harrison@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
putenv(allow_no_stats_env);
mock_init_alloc_hooks();
init_mock_server(true);
putenv(allow_no_stats_env);
mock_init_alloc_hooks();
init_mock_server(true);
- HashTable::setDefaultNumLocks(47);
initialize_time_functions(get_mock_server_api()->core);
::benchmark::Initialize(&argc, argv);
::benchmark::RunSpecifiedBenchmarks();
initialize_time_functions(get_mock_server_api()->core);
::benchmark::Initialize(&argc, argv);
::benchmark::RunSpecifiedBenchmarks();
// prime in our table - this still gives space for 3072 HT slots but
// minimizes fixed overheads.
size_t HashTable::defaultNumBuckets = 3;
// prime in our table - this still gives space for 3072 HT slots but
// minimizes fixed overheads.
size_t HashTable::defaultNumBuckets = 3;
-size_t HashTable::defaultNumLocks = 193;
+size_t HashTable::defaultNumLocks = 47;
static ssize_t prime_size_table[] = {
3, 7, 13, 23, 47, 97, 193, 383, 769, 1531, 3079, 6143, 12289, 24571, 49157,
static ssize_t prime_size_table[] = {
3, 7, 13, 23, 47, 97, 193, 383, 769, 1531, 3079, 6143, 12289, 24571, 49157,
}
Logger::setLoggerAPI(get_mock_server_api()->log);
}
Logger::setLoggerAPI(get_mock_server_api()->log);
- // Default number of hashtable locks is too large for TSan to
- // track. Use the value in configuration.json (47 at time of
- // writing).
- HashTable::setDefaultNumLocks(Configuration().getHtLocks());
-
// Need to initialize ep_real_time and friends.
initialize_time_functions(get_mock_server_api()->core);
// Need to initialize ep_real_time and friends.
initialize_time_functions(get_mock_server_api()->core);