| 1373 | |
| 1374 | |
| 1375 | HugePagePoolOfPools HugePagePoolOfPools::from_desc(const std::string& desc) { |
| 1376 | std::map<size_t, size_t> conf; // buffer_size -> buffers_in_pool |
| 1377 | std::map<std::string, std::string> exploded_str_conf; |
| 1378 | get_str_map(desc, &exploded_str_conf); |
| 1379 | for (const auto& [buffer_size_s, buffers_in_pool_s] : exploded_str_conf) { |
| 1380 | size_t buffer_size, buffers_in_pool; |
| 1381 | if (sscanf(buffer_size_s.c_str(), "%zu", &buffer_size) != 1) { |
| 1382 | ceph_abort("can't parse a key in the configuration"); |
| 1383 | } |
| 1384 | if (sscanf(buffers_in_pool_s.c_str(), "%zu", &buffers_in_pool) != 1) { |
| 1385 | ceph_abort("can't parse a value in the configuration"); |
| 1386 | } |
| 1387 | conf[buffer_size] = buffers_in_pool; |
| 1388 | } |
| 1389 | return HugePagePoolOfPools{std::move(conf)}; |
| 1390 | } |
| 1391 | |
| 1392 | // create a buffer basing on user-configurable. it's intended to make |
| 1393 | // our buffers THP-able. |
nothing calls this directly
no test coverage detected