ircd::ctx::pool: Upgrade various opts sites to designated inits; minor inline.

This commit is contained in:
Jason Volk 2023-02-19 18:42:11 -08:00
parent 5a35d63b64
commit c30776fc59
7 changed files with 26 additions and 33 deletions

View File

@ -171,3 +171,9 @@ const
assert(opt);
return *opt;
}
inline const ircd::string_view &
ircd::ctx::name(const pool &pool)
{
return pool.name;
}

View File

@ -88,8 +88,8 @@ ircd::client::log
decltype(ircd::client::pool_opts)
ircd::client::pool_opts
{
size_t(settings.stack_size),
size_t(settings.pool_size),
.stack_size = size_t(settings.stack_size),
.initial_ctxs = size_t(settings.pool_size),
};
/// The pool of request contexts. When a client makes a request it does so by acquiring

View File

@ -1404,12 +1404,6 @@ ircd::ctx::context::detach()
// ctx_pool.h
//
const ircd::string_view &
ircd::ctx::name(const pool &pool)
{
return pool.name;
}
decltype(ircd::ctx::pool::default_name)
ircd::ctx::pool::default_name
{

View File

@ -71,11 +71,11 @@ ircd::db::request_pool_size
decltype(ircd::db::request_pool_opts)
ircd::db::request_pool_opts
{
size_t(request_pool_stack_size),
size_t(request_pool_size),
-1, // No hard limit
0, // Soft limit at any queued
true, // Yield before hitting soft limit
.stack_size = size_t(request_pool_stack_size),
.initial_ctxs = size_t(request_pool_size),
.queue_max_hard = -1,
.queue_max_soft = 0, // Soft limit at any queued
.queue_max_blocking = true, // Yield before hitting soft limit
};
/// Concurrent request pool. Requests to seek may be executed on this

View File

@ -4091,14 +4091,14 @@ ircd::db::database::env::state::pool::pool(database &d,
}
,popts
{
size_t(stack_size), // stack size of worker
0, // initial workers
-1, // queue hard limit
-1, // queue soft limit
true, // queue_max_blocking
true, // queue_max_dwarning
make_nice(iopri), // ionice
make_nice(this->pri), // nice
.stack_size = size_t(stack_size),
.initial_ctxs = 0,
.queue_max_hard = -1,
.queue_max_soft = -1,
.queue_max_blocking = true,
.queue_max_dwarning = true,
.ionice = make_nice(iopri),
.nice = make_nice(this->pri),
}
,p
{

View File

@ -254,14 +254,10 @@ try
// The context pool lives directly in this frame.
static const ctx::pool::opts pool_opts
{
512_KiB, // stack sz
size_t(pool_size), // pool sz
-1, // queue max hard
0, // queue max soft
true, // queue max blocking
true, // queue max warning
3, // ionice
3, // nice
.stack_size = 512_KiB,
.initial_ctxs = size_t(pool_size),
.ionice = 3,
.nice = 3,
};
ctx::pool pool

View File

@ -20,10 +20,7 @@ ircd::m::sync::log
};
decltype(ircd::m::sync::pool_opts)
ircd::m::sync::pool_opts
{
ctx::DEFAULT_STACK_SIZE, 0, -1, 0
};
ircd::m::sync::pool_opts;
decltype(ircd::m::sync::pool)
ircd::m::sync::pool