summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-12-19 16:06:16 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-12-20 05:10:52 +0000
commita00e560b0d8267e9b376e5c0e6a2139a7be63281 (patch)
treeba207915b8cac9fb92493cc103821f6cce9db31b /storage
parent05b58ac83b06b00ae97ecafad101e44d4dd76aee (diff)
Remove stacksize from the thread pools and thread executors.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/persistence/filestorage/filestormanagertest.cpp2
-rw-r--r--storage/src/tests/storageserver/statereportertest.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/distributor_stripe_pool.h6
-rw-r--r--storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp5
-rw-r--r--storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp2
-rw-r--r--storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp5
-rw-r--r--storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.h9
8 files changed, 19 insertions, 16 deletions
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
index a5f5075a4d8..50ad7b54382 100644
--- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
+++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
@@ -606,7 +606,7 @@ TEST_F(FileStorManagerTest, handler_paused_multi_thread) {
Document::SP doc(createDocument(content, "id:footype:testdoctype1:n=1234:bar").release());
- FastOS_ThreadPool pool(512_Ki);
+ FastOS_ThreadPool pool;
MessagePusherThread pushthread(filestorHandler, doc);
pushthread.start(pool);
diff --git a/storage/src/tests/storageserver/statereportertest.cpp b/storage/src/tests/storageserver/statereportertest.cpp
index 09df5063989..d7c5bdbf6ea 100644
--- a/storage/src/tests/storageserver/statereportertest.cpp
+++ b/storage/src/tests/storageserver/statereportertest.cpp
@@ -61,7 +61,7 @@ struct MetricClock : public metrics::MetricManager::Timer
}
StateReporterTest::StateReporterTest()
- : _threadPool(256_Ki),
+ : _threadPool(),
_clock(nullptr),
_top(),
_stateReporter()
diff --git a/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp b/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp
index 30d13e4eb1a..26ca8963783 100644
--- a/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp
+++ b/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp
@@ -8,7 +8,7 @@
namespace storage::distributor {
DistributorStripePool::DistributorStripePool(bool test_mode, PrivateCtorTag)
- : _thread_pool(512_Ki),
+ : _thread_pool(std::make_unique<FastOS_ThreadPool>()),
_n_stripe_bits(0),
_stripes(),
_threads(),
@@ -119,7 +119,7 @@ void DistributorStripePool::start(const std::vector<TickableStripe*>& stripes) {
}
std::unique_lock lock(_mutex); // Ensure _threads is visible to all started threads
for (auto& s : _stripes) {
- _threads.emplace_back(_thread_pool.NewThread(s.get()));
+ _threads.emplace_back(_thread_pool->NewThread(s.get()));
}
}
diff --git a/storage/src/vespa/storage/distributor/distributor_stripe_pool.h b/storage/src/vespa/storage/distributor/distributor_stripe_pool.h
index 605ca34a2b2..00f5f57edf9 100644
--- a/storage/src/vespa/storage/distributor/distributor_stripe_pool.h
+++ b/storage/src/vespa/storage/distributor/distributor_stripe_pool.h
@@ -1,13 +1,15 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/fastos/thread.h>
#include <vespa/vespalib/util/time.h>
#include <atomic>
#include <condition_variable>
#include <mutex>
#include <vector>
+class FastOS_ThreadInterface;
+class FastOS_ThreadPool;
+
namespace storage::distributor {
class DistributorStripeThread;
@@ -37,7 +39,7 @@ class DistributorStripePool {
using StripeVector = std::vector<std::unique_ptr<DistributorStripeThread>>;
using NativeThreadVector = std::vector<FastOS_ThreadInterface*>;
- FastOS_ThreadPool _thread_pool;
+ std::unique_ptr<FastOS_ThreadPool> _thread_pool;
uint8_t _n_stripe_bits;
StripeVector _stripes;
NativeThreadVector _threads;
diff --git a/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp b/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp
index b2bce8a1241..40738ccb60f 100644
--- a/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp
+++ b/storage/src/vespa/storage/frameworkimpl/status/statuswebserver.cpp
@@ -15,6 +15,9 @@
#include <vespa/log/log.h>
LOG_SETUP(".status");
+namespace {
+ VESPA_THREAD_STACK_TAG(status_web_server);
+}
namespace storage {
StatusWebServer::StatusWebServer(
@@ -81,7 +84,7 @@ void StatusWebServer::configure(std::unique_ptr<vespa::config::content::core::St
StatusWebServer::WebServer::WebServer(StatusWebServer& status, uint16_t port)
: _status(status),
_server(vespalib::Portal::create(vespalib::CryptoEngine::get_default(), port)),
- _executor(1, 256_Ki),
+ _executor(1, status_web_server),
_root(_server->bind("/", *this))
{
}
diff --git a/storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp b/storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp
index c98617c84bf..d3226d91f24 100644
--- a/storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp
+++ b/storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp
@@ -64,7 +64,7 @@ SharedRpcResources::SharedRpcResources(const config::ConfigUri& config_uri,
int rpc_server_port,
size_t rpc_thread_pool_size,
size_t rpc_events_before_wakeup)
- : _thread_pool(std::make_unique<FastOS_ThreadPool>(1024*60)),
+ : _thread_pool(std::make_unique<FastOS_ThreadPool>()),
_transport(std::make_unique<FNET_Transport>(fnet::TransportConfig(rpc_thread_pool_size).
events_before_wakeup(rpc_events_before_wakeup))),
_orb(std::make_unique<FRT_Supervisor>(_transport.get())),
diff --git a/storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp b/storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp
index 6ac4e214e5d..95959d06b54 100644
--- a/storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp
+++ b/storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.cpp
@@ -3,7 +3,6 @@
#include "threadpoolimpl.h"
#include "threadimpl.h"
#include <vespa/vespalib/util/exceptions.h>
-#include <vespa/vespalib/util/size_literals.h>
#include <cassert>
#include <thread>
@@ -16,7 +15,7 @@ using vespalib::IllegalStateException;
namespace storage::framework::defaultimplementation {
ThreadPoolImpl::ThreadPoolImpl(Clock& clock)
- : _backendThreadPool(512_Ki),
+ : _backendThreadPool(std::make_unique<FastOS_ThreadPool>()),
_clock(clock),
_stopping(false)
{ }
@@ -45,7 +44,7 @@ ThreadPoolImpl::~ThreadPoolImpl()
}
std::this_thread::sleep_for(10ms);
}
- _backendThreadPool.Close();
+ _backendThreadPool->Close();
}
Thread::UP
diff --git a/storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.h b/storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.h
index dcdc0981fe4..c351eb2ddd0 100644
--- a/storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.h
+++ b/storage/src/vespa/storageframework/defaultimplementation/thread/threadpoolimpl.h
@@ -3,7 +3,8 @@
#pragma once
#include <vespa/storageframework/generic/thread/threadpool.h>
-#include <vespa/fastos/thread.h>
+
+class FastOS_ThreadPool;
namespace storage::framework::defaultimplementation {
@@ -11,7 +12,7 @@ class ThreadImpl;
struct ThreadPoolImpl final : public ThreadPool
{
- FastOS_ThreadPool _backendThreadPool;
+ std::unique_ptr<FastOS_ThreadPool> _backendThreadPool;
std::vector<ThreadImpl*> _threads;
mutable std::mutex _threadVectorLock;
Clock & _clock;
@@ -25,10 +26,8 @@ public:
vespalib::duration maxProcessTime, int ticksBeforeWait,
std::optional<vespalib::CpuUsage::Category> cpu_category) override;
void visitThreads(ThreadVisitor&) const override;
-
- void registerThread(ThreadImpl&);
void unregisterThread(ThreadImpl&);
- FastOS_ThreadPool& getThreadPool() { return _backendThreadPool; }
+ FastOS_ThreadPool& getThreadPool() { return *_backendThreadPool; }
Clock& getClock() { return _clock; }
};