From 3c8ceb028df389a6b7c4a72789cba52f24f8384f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 11 Nov 2015 10:33:24 -0800 Subject: [PATCH] client: add config option to not lower client priority We added code a couple of months ago to lower client priority: on Win, this is SetPriorityClass(), which lowers I/O and memory priority as well as CPU. This has the desired effect, i.e. to reduce the performance impact of BOINC when it's doing things like copying large files. However, it means that BOINC can take a long time to start at boot, which may be disconcerting to some users. --- client/client_state.cpp | 4 +++- client/log_flags.cpp | 4 ++++ lib/cc_config.cpp | 4 ++++ lib/cc_config.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client/client_state.cpp b/client/client_state.cpp index cbd5901f47..1b1ceba57b 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -460,7 +460,9 @@ int CLIENT_STATE::init() { msg_printf(NULL, MSG_INFO, "Libraries: %s", curl_version()); - set_client_priority(); + if (!cc_config.dont_lower_client_priority) { + set_client_priority(); + } if (executing_as_daemon) { #ifdef _WIN32 diff --git a/client/log_flags.cpp b/client/log_flags.cpp index fa4b41f9b6..7bc128b5ab 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -188,6 +188,9 @@ void CC_CONFIG::show() { if (dont_check_file_sizes) { msg_printf(NULL, MSG_INFO, "Config: don't check file sizes"); } + if (dont_lower_client_priority) { + msg_printf(NULL, MSG_INFO, "Config: don't lower client priority"); + } if (dont_suspend_nci) { msg_printf(NULL, MSG_INFO, "Config: don't suspend NCI tasks"); } @@ -346,6 +349,7 @@ int CC_CONFIG::parse_options_client(XML_PARSER& xp) { if (xp.parse_bool("disallow_attach", disallow_attach)) continue; if (xp.parse_bool("dont_check_file_sizes", dont_check_file_sizes)) continue; if (xp.parse_bool("dont_contact_ref_site", dont_contact_ref_site)) continue; + if (xp.parse_bool("dont_lower_client_priority", dont_lower_client_priority)) continue; if (xp.parse_bool("dont_suspend_nci", dont_suspend_nci)) continue; if (xp.parse_bool("dont_use_vbox", dont_use_vbox)) continue; if (xp.match_tag("exclude_gpu")) { diff --git a/lib/cc_config.cpp b/lib/cc_config.cpp index 711fc87b95..d205c36cea 100644 --- a/lib/cc_config.cpp +++ b/lib/cc_config.cpp @@ -208,6 +208,7 @@ void CC_CONFIG::defaults() { disallow_attach = false; dont_check_file_sizes = false; dont_contact_ref_site = false; + dont_lower_client_priority = false; dont_suspend_nci = false; dont_use_vbox = false; exclude_gpus.clear(); @@ -341,6 +342,7 @@ int CC_CONFIG::parse_options(XML_PARSER& xp) { if (xp.parse_bool("disallow_attach", disallow_attach)) continue; if (xp.parse_bool("dont_check_file_sizes", dont_check_file_sizes)) continue; if (xp.parse_bool("dont_contact_ref_site", dont_contact_ref_site)) continue; + if (xp.parse_bool("dont_lower_client_priority", dont_lower_client_priority)) continue; if (xp.parse_bool("dont_suspend_nci", dont_suspend_nci)) continue; if (xp.parse_bool("dont_use_vbox", dont_use_vbox)) continue; if (xp.match_tag("exclude_gpu")) { @@ -547,11 +549,13 @@ int CC_CONFIG::write(MIOFILE& out, LOG_FLAGS& log_flags) { " %d\n" " %d\n" " %d\n" + " %d\n" " %d\n" " %d\n", disallow_attach, dont_check_file_sizes, dont_contact_ref_site, + dont_lower_client_priority, dont_suspend_nci, dont_use_vbox ); diff --git a/lib/cc_config.h b/lib/cc_config.h index 8f8eec493d..fea507d3fa 100644 --- a/lib/cc_config.h +++ b/lib/cc_config.h @@ -149,6 +149,7 @@ struct CC_CONFIG { bool disallow_attach; bool dont_check_file_sizes; bool dont_contact_ref_site; + bool dont_lower_client_priority; bool dont_suspend_nci; bool dont_use_vbox; std::vector exclude_gpus;