Skip to content

Commit

Permalink
MB-24055: change defaultNumLocks from 193 to 47 (logical no-op).
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
daverigby committed May 11, 2017
1 parent d3a497a commit 8b4ab1a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion benchmarks/access_scanner_bench.cc
Expand Up @@ -169,7 +169,6 @@ int main(int argc, char** argv) {
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();
Expand Down
2 changes: 1 addition & 1 deletion src/hash_table.cc
Expand Up @@ -25,7 +25,7 @@
// 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,
Expand Down
5 changes: 0 additions & 5 deletions tests/module_tests/ep_unit_tests_main.cc
Expand Up @@ -66,11 +66,6 @@ int main(int argc, char **argv) {
}
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);

Expand Down

0 comments on commit 8b4ab1a

Please sign in to comment.