[RocksDB] Introduce Fast Mutex option

Summary:
This diff adds an option to specify whether PTHREAD_MUTEX_ADAPTIVE_NP will be enabled for the rocksdb single big kernel lock. db_bench also have this option now.
Quickly tested 8 thread cpu bound 100 byte random read.
No fast mutex: ~750k/s ops
With fast mutex: ~880k/s ops

Test Plan: make check; db_bench; db_stress

Reviewers: dhruba

CC: MarkCallaghan, leveldb

Differential Revision: https://reviews.facebook.net/D11031
This commit is contained in:
Haobo Xu
2013-05-31 16:30:17 -07:00
parent ab8d2f6ab2
commit d897d33bf1
6 changed files with 42 additions and 3 deletions

View File

@@ -73,7 +73,8 @@ Options::Options()
stats_dump_period_sec(3600),
block_size_deviation (10),
advise_random_on_open(true),
access_hint_on_compaction_start(NORMAL) {
access_hint_on_compaction_start(NORMAL),
use_adaptive_mutex(false) {
}
static const char* const access_hints[] = {
@@ -208,6 +209,8 @@ Options::Dump(Logger* log) const
advise_random_on_open);
Log(log," Options.access_hint_on_compaction_start: %s",
access_hints[access_hint_on_compaction_start]);
Log(log," Options.use_adaptive_mutex: %d",
use_adaptive_mutex);
} // Options::Dump
//