|
|
@ -251,210 +251,6 @@ _calculate_thread_counts(int *read_thread_count_, |
|
|
|
*process_thread_queue_depth_ *= *process_thread_count_; |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads_R1P(const CPU::ThreadIdVec read_threads_) |
|
|
|
{ |
|
|
|
CPU::Core2CPUsMap core2cpus; |
|
|
|
|
|
|
|
core2cpus = CPU::core2cpus(); |
|
|
|
if(core2cpus.empty()) |
|
|
|
return; |
|
|
|
|
|
|
|
for(auto const thread_id : read_threads_) |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads_RP1L(const CPU::ThreadIdVec read_threads_, |
|
|
|
const CPU::ThreadIdVec process_threads_) |
|
|
|
{ |
|
|
|
CPU::CPUVec cpus; |
|
|
|
|
|
|
|
cpus = CPU::cpus(); |
|
|
|
if(cpus.empty()) |
|
|
|
return; |
|
|
|
|
|
|
|
for(auto const thread_id : read_threads_) |
|
|
|
CPU::setaffinity(thread_id,cpus.front()); |
|
|
|
for(auto const thread_id : process_threads_) |
|
|
|
CPU::setaffinity(thread_id,cpus.front()); |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads_RP1P(const CPU::ThreadIdVec read_threads_, |
|
|
|
const CPU::ThreadIdVec process_threads_) |
|
|
|
{ |
|
|
|
CPU::Core2CPUsMap core2cpus; |
|
|
|
|
|
|
|
core2cpus = CPU::core2cpus(); |
|
|
|
if(core2cpus.empty()) |
|
|
|
return; |
|
|
|
|
|
|
|
for(auto const thread_id : read_threads_) |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
for(auto const thread_id : process_threads_) |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads_R1LP1L(const std::vector<pthread_t> read_threads_, |
|
|
|
const std::vector<pthread_t> process_threads_) |
|
|
|
{ |
|
|
|
CPU::CPUVec cpus; |
|
|
|
|
|
|
|
cpus = CPU::cpus(); |
|
|
|
if(cpus.empty()) |
|
|
|
return; |
|
|
|
|
|
|
|
for(auto const thread_id : read_threads_) |
|
|
|
CPU::setaffinity(thread_id,cpus.front()); |
|
|
|
|
|
|
|
for(auto const thread_id : process_threads_) |
|
|
|
CPU::setaffinity(thread_id,cpus.back()); |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads_R1PP1P(const std::vector<pthread_t> read_threads_, |
|
|
|
const std::vector<pthread_t> process_threads_) |
|
|
|
{ |
|
|
|
CPU::Core2CPUsMap core2cpus; |
|
|
|
|
|
|
|
core2cpus = CPU::core2cpus(); |
|
|
|
if(core2cpus.empty()) |
|
|
|
return; |
|
|
|
|
|
|
|
for(auto const thread_id : read_threads_) |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
|
|
|
|
if(core2cpus.size() > 1) |
|
|
|
core2cpus.erase(core2cpus.begin()); |
|
|
|
|
|
|
|
for(auto const thread_id : process_threads_) |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads_RPSL(const std::vector<pthread_t> read_threads_, |
|
|
|
const std::vector<pthread_t> process_threads_) |
|
|
|
{ |
|
|
|
CPU::CPUVec cpus; |
|
|
|
|
|
|
|
cpus = CPU::cpus(); |
|
|
|
if(cpus.empty()) |
|
|
|
return; |
|
|
|
|
|
|
|
for(auto const thread_id : read_threads_) |
|
|
|
{ |
|
|
|
if(cpus.empty()) |
|
|
|
cpus = CPU::cpus(); |
|
|
|
CPU::setaffinity(thread_id,cpus.back()); |
|
|
|
cpus.pop_back(); |
|
|
|
} |
|
|
|
|
|
|
|
for(auto const thread_id : process_threads_) |
|
|
|
{ |
|
|
|
if(cpus.empty()) |
|
|
|
cpus = CPU::cpus(); |
|
|
|
CPU::setaffinity(thread_id,cpus.back()); |
|
|
|
cpus.pop_back(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads_RPSP(const std::vector<pthread_t> read_threads_, |
|
|
|
const std::vector<pthread_t> process_threads_) |
|
|
|
{ |
|
|
|
CPU::Core2CPUsMap core2cpus; |
|
|
|
|
|
|
|
core2cpus = CPU::core2cpus(); |
|
|
|
if(core2cpus.empty()) |
|
|
|
return; |
|
|
|
|
|
|
|
for(auto const thread_id : read_threads_) |
|
|
|
{ |
|
|
|
if(core2cpus.empty()) |
|
|
|
core2cpus = CPU::core2cpus(); |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
core2cpus.erase(core2cpus.begin()); |
|
|
|
} |
|
|
|
|
|
|
|
for(auto const thread_id : process_threads_) |
|
|
|
{ |
|
|
|
if(core2cpus.empty()) |
|
|
|
core2cpus = CPU::core2cpus(); |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
core2cpus.erase(core2cpus.begin()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads_R1PPSP(const std::vector<pthread_t> read_threads_, |
|
|
|
const std::vector<pthread_t> process_threads_) |
|
|
|
{ |
|
|
|
CPU::Core2CPUsMap core2cpus; |
|
|
|
CPU::Core2CPUsMap leftover; |
|
|
|
|
|
|
|
core2cpus = CPU::core2cpus(); |
|
|
|
if(core2cpus.empty()) |
|
|
|
return; |
|
|
|
|
|
|
|
for(auto const thread_id : read_threads_) |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
|
|
|
|
core2cpus.erase(core2cpus.begin()); |
|
|
|
if(core2cpus.empty()) |
|
|
|
core2cpus = CPU::core2cpus(); |
|
|
|
leftover = core2cpus; |
|
|
|
|
|
|
|
for(auto const thread_id : process_threads_) |
|
|
|
{ |
|
|
|
if(core2cpus.empty()) |
|
|
|
core2cpus = leftover; |
|
|
|
CPU::setaffinity(thread_id,core2cpus.begin()->second); |
|
|
|
core2cpus.erase(core2cpus.begin()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
pin_threads(const std::vector<pthread_t> read_threads_, |
|
|
|
const std::vector<pthread_t> process_threads_, |
|
|
|
const std::string type_) |
|
|
|
{ |
|
|
|
if(type_.empty() || (type_ == "false")) |
|
|
|
return; |
|
|
|
if(type_ == "R1L") |
|
|
|
return PinThreads::R1L(read_threads_); |
|
|
|
if(type_ == "R1P") |
|
|
|
return ::pin_threads_R1P(read_threads_); |
|
|
|
if(type_ == "RP1L") |
|
|
|
return ::pin_threads_RP1L(read_threads_,process_threads_); |
|
|
|
if(type_ == "RP1P") |
|
|
|
return ::pin_threads_RP1P(read_threads_,process_threads_); |
|
|
|
if(type_ == "R1LP1L") |
|
|
|
return ::pin_threads_R1LP1L(read_threads_,process_threads_); |
|
|
|
if(type_ == "R1PP1P") |
|
|
|
return ::pin_threads_R1PP1P(read_threads_,process_threads_); |
|
|
|
if(type_ == "RPSL") |
|
|
|
return ::pin_threads_RPSL(read_threads_,process_threads_); |
|
|
|
if(type_ == "RPSP") |
|
|
|
return ::pin_threads_RPSP(read_threads_,process_threads_); |
|
|
|
if(type_ == "R1PPSP") |
|
|
|
return ::pin_threads_R1PPSP(read_threads_,process_threads_); |
|
|
|
|
|
|
|
syslog(LOG_WARNING, |
|
|
|
"Invalid pin-threads value, ignoring: %s", |
|
|
|
type_.c_str()); |
|
|
|
} |
|
|
|
|
|
|
|
static |
|
|
|
void |
|
|
|
_wait(fuse_session *se_, |
|
|
|