diff --git a/include/ircd/ctx/pool.h b/include/ircd/ctx/pool.h index c0efe5155..eaf0c5605 100644 --- a/include/ircd/ctx/pool.h +++ b/include/ircd/ctx/pool.h @@ -171,3 +171,9 @@ const assert(opt); return *opt; } + +inline const ircd::string_view & +ircd::ctx::name(const pool &pool) +{ + return pool.name; +} diff --git a/ircd/client.cc b/ircd/client.cc index 7665aa3d4..fbbe8aee1 100644 --- a/ircd/client.cc +++ b/ircd/client.cc @@ -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 diff --git a/ircd/ctx.cc b/ircd/ctx.cc index e7da4f41e..e6a2b0e80 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -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 { diff --git a/ircd/db.cc b/ircd/db.cc index aebc7ac0c..68f9beb4f 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -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 diff --git a/ircd/db_env.cc b/ircd/db_env.cc index 39cafd1de..a3d6e87ce 100644 --- a/ircd/db_env.cc +++ b/ircd/db_env.cc @@ -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 { diff --git a/matrix/init_backfill.cc b/matrix/init_backfill.cc index fb4434501..32074f73a 100644 --- a/matrix/init_backfill.cc +++ b/matrix/init_backfill.cc @@ -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 diff --git a/matrix/sync.cc b/matrix/sync.cc index 87ce6cd9d..25a2584e9 100644 --- a/matrix/sync.cc +++ b/matrix/sync.cc @@ -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