From: Yingxin Cheng Date: Mon, 3 Jul 2023 08:19:51 +0000 (+0800) Subject: crimson/tools/perf_crimson_msgr: client don't skip core 0 if specified explicitly X-Git-Tag: v18.2.1~129^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=00ff3df1662c35d52b80721e1d6d72407dc97ada;p=ceph-ci.git crimson/tools/perf_crimson_msgr: client don't skip core 0 if specified explicitly Usually, we skip core 0 to avoid unwanted performance impacts, but that may not be always the case. Add the configuration not to skip core 0. Signed-off-by: Yingxin Cheng (cherry picked from commit a2df1d0942b4f756a78de4608a464948415c92a1) --- diff --git a/src/crimson/tools/perf_crimson_msgr.cc b/src/crimson/tools/perf_crimson_msgr.cc index 62b5aab80b6..1e4bde97dac 100644 --- a/src/crimson/tools/perf_crimson_msgr.cc +++ b/src/crimson/tools/perf_crimson_msgr.cc @@ -87,6 +87,7 @@ struct client_config { unsigned num_clients; unsigned num_conns; unsigned depth; + bool skip_core_0; std::string str() const { std::ostringstream out; @@ -97,6 +98,7 @@ struct client_config { << ", num_clients=" << num_clients << ", num_conns=" << num_conns << ", depth=" << depth + << ", skip_core_0=" << skip_core_0 << ")"; return out.str(); } @@ -116,6 +118,7 @@ struct client_config { conf.num_conns = options["conns-per-client"].as(); ceph_assert_always(conf.num_conns > 0); conf.depth = options["depth"].as(); + conf.skip_core_0 = options["client-skip-core-0"].as(); return conf; } }; @@ -589,7 +592,6 @@ static seastar::future<> run( msg_len{msg_len}, nr_depth{_depth} { if (is_active()) { - assert(sid > 0); for (unsigned i = 0; i < num_conns; ++i) { conn_states.emplace_back(nr_depth); } @@ -644,7 +646,6 @@ static seastar::future<> run( // should start messenger at this shard? bool is_active() { ceph_assert(seastar::this_shard_id() == sid); - ceph_assert(seastar::smp::count > num_clients); return sid + num_clients >= seastar::smp::count; } @@ -1107,7 +1108,11 @@ static seastar::future<> run( if (mode == perf_mode_t::both) { logger().info("\nperf settings:\n smp={}\n {}\n {}\n", seastar::smp::count, client_conf.str(), server_conf.str()); - ceph_assert(seastar::smp::count > client_conf.num_clients); + if (client_conf.skip_core_0) { + ceph_assert(seastar::smp::count > client_conf.num_clients); + } else { + ceph_assert(seastar::smp::count >= client_conf.num_clients); + } ceph_assert(client_conf.num_clients > 0); ceph_assert(seastar::smp::count > server_conf.core + client_conf.num_clients); return seastar::when_all_succeed( @@ -1128,7 +1133,11 @@ static seastar::future<> run( } else if (mode == perf_mode_t::client) { logger().info("\nperf settings:\n smp={}\n {}\n", seastar::smp::count, client_conf.str()); - ceph_assert(seastar::smp::count > client_conf.num_clients); + if (client_conf.skip_core_0) { + ceph_assert(seastar::smp::count > client_conf.num_clients); + } else { + ceph_assert(seastar::smp::count >= client_conf.num_clients); + } ceph_assert(client_conf.num_clients > 0); return client->init( ).then([client, addr = client_conf.server_addr] { @@ -1178,6 +1187,8 @@ int main(int argc, char** argv) "client block size") ("depth", bpo::value()->default_value(512), "client io depth per job") + ("client-skip-core-0", bpo::value()->default_value(true), + "client skip core 0") ("server-fixed-cpu", bpo::value()->default_value(true), "server is in the fixed cpu mode, non-fixed doesn't support the mode both") ("server-core", bpo::value()->default_value(1),