You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by zu...@apache.org on 2016/05/05 06:16:56 UTC
[20/30] incubator-quickstep git commit: Fixes a bug where numa
settings were not properly set (not compiled in) (#205)
Fixes a bug where numa settings were not properly set (not compiled in) (#205)
Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/db47654f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/db47654f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/db47654f
Branch: refs/heads/master
Commit: db47654f5d4e93082c6118ef45ea54eb71972c9d
Parents: 9d64761
Author: Marc S <cr...@users.noreply.github.com>
Authored: Tue May 3 12:06:38 2016 -0500
Committer: Zuyu Zhang <zz...@pivotal.io>
Committed: Wed May 4 23:15:35 2016 -0700
----------------------------------------------------------------------
cli/DefaultsConfigurator.hpp | 16 ++++++++++++++++
cli/InputParserUtil.cpp | 1 +
cli/QuickstepCli.cpp | 6 +++---
3 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/db47654f/cli/DefaultsConfigurator.hpp
----------------------------------------------------------------------
diff --git a/cli/DefaultsConfigurator.hpp b/cli/DefaultsConfigurator.hpp
index b40ef87..4da05b2 100644
--- a/cli/DefaultsConfigurator.hpp
+++ b/cli/DefaultsConfigurator.hpp
@@ -22,6 +22,7 @@
#include <unordered_map>
#include <vector>
+#include "storage/StorageConfig.h"
#include "utility/Macros.hpp"
#ifdef QUICKSTEP_HAVE_LIBNUMA
@@ -51,6 +52,21 @@ class DefaultsConfigurator {
}
/**
+ * @brief Get the number of available numa sockets.
+ *
+ * @return Number of available numa sockets. Always 1 if the system doesn't
+ * have libnuma.
+ **/
+ static std::size_t GetNumNUMANodes() {
+ #ifdef QUICKSTEP_HAVE_LIBNUMA
+ // Id of the maximum node.
+ return numa_max_node() + 1;
+ #else
+ return 1;
+ #endif
+ }
+
+ /**
* @brief Get the number of NUMA nodes covered by the given worker affinities
* to the CPU cores.
*
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/db47654f/cli/InputParserUtil.cpp
----------------------------------------------------------------------
diff --git a/cli/InputParserUtil.cpp b/cli/InputParserUtil.cpp
index 328aaeb..352883e 100644
--- a/cli/InputParserUtil.cpp
+++ b/cli/InputParserUtil.cpp
@@ -24,6 +24,7 @@
#include <vector>
#include "catalog/CatalogConfig.h"
+#include "storage/StorageConfig.h"
#include "utility/StringUtil.hpp"
#include "glog/logging.h"
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/db47654f/cli/QuickstepCli.cpp
----------------------------------------------------------------------
diff --git a/cli/QuickstepCli.cpp b/cli/QuickstepCli.cpp
index 8dee1f7..ec195f7 100644
--- a/cli/QuickstepCli.cpp
+++ b/cli/QuickstepCli.cpp
@@ -258,8 +258,7 @@ int main(int argc, char* argv[]) {
InputParserUtil::ParseWorkerAffinities(real_num_workers,
quickstep::FLAGS_worker_affinities);
- const std::size_t num_numa_nodes_covered =
- DefaultsConfigurator::GetNumNUMANodesCoveredByWorkers(worker_cpu_affinities);
+ const std::size_t num_numa_nodes_system = DefaultsConfigurator::GetNumNUMANodes();
if (quickstep::FLAGS_preload_buffer_pool) {
std::chrono::time_point<std::chrono::steady_clock> preload_start, preload_end;
@@ -280,7 +279,8 @@ int main(int argc, char* argv[]) {
Foreman foreman(&bus,
query_processor->getDefaultDatabase(),
query_processor->getStorageManager(),
- num_numa_nodes_covered);
+ -1, /* CPU id to bind foreman. -1 is unbound. */
+ num_numa_nodes_system);
// Get the NUMA affinities for workers.
vector<int> cpu_numa_nodes = InputParserUtil::GetNUMANodesForCPUs();