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); assert(opt);
return *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) decltype(ircd::client::pool_opts)
ircd::client::pool_opts ircd::client::pool_opts
{ {
size_t(settings.stack_size), .stack_size = size_t(settings.stack_size),
size_t(settings.pool_size), .initial_ctxs = size_t(settings.pool_size),
}; };
/// The pool of request contexts. When a client makes a request it does so by acquiring /// 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 // ctx_pool.h
// //
const ircd::string_view &
ircd::ctx::name(const pool &pool)
{
return pool.name;
}
decltype(ircd::ctx::pool::default_name) decltype(ircd::ctx::pool::default_name)
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) decltype(ircd::db::request_pool_opts)
ircd::db::request_pool_opts ircd::db::request_pool_opts
{ {
size_t(request_pool_stack_size), .stack_size = size_t(request_pool_stack_size),
size_t(request_pool_size), .initial_ctxs = size_t(request_pool_size),
-1, // No hard limit .queue_max_hard = -1,
0, // Soft limit at any queued .queue_max_soft = 0, // Soft limit at any queued
true, // Yield before hitting soft limit .queue_max_blocking = true, // Yield before hitting soft limit
}; };
/// Concurrent request pool. Requests to seek may be executed on this /// 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 ,popts
{ {
size_t(stack_size), // stack size of worker .stack_size = size_t(stack_size),
0, // initial workers .initial_ctxs = 0,
-1, // queue hard limit .queue_max_hard = -1,
-1, // queue soft limit .queue_max_soft = -1,
true, // queue_max_blocking .queue_max_blocking = true,
true, // queue_max_dwarning .queue_max_dwarning = true,
make_nice(iopri), // ionice .ionice = make_nice(iopri),
make_nice(this->pri), // nice .nice = make_nice(this->pri),
} }
,p ,p
{ {

View File

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

View File

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