0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd::ctx: Add nice/ionice values to pool opts; propagate on spawn.

This commit is contained in:
Jason Volk 2020-01-06 12:01:04 -08:00
parent 78d300b3b7
commit 4ef3f6eab7
2 changed files with 12 additions and 0 deletions

View file

@ -108,6 +108,12 @@ struct ircd::ctx::pool::opts
/// are blocked from submitting (see: queue_max_blocking). This warning
/// will still be seen for submissions outside any ircd::ctx.
bool queue_max_dwarning {true};
/// IO priority nice value for contexts in this pool.
int8_t ionice {0};
/// Scheduler priority nice value for contexts in this pool.
int8_t nice {0};
};
template<class F,

View file

@ -1515,7 +1515,13 @@ ircd::ctx::pool::add(const size_t &num)
{
assert(opt);
for(size_t i(0); i < num; ++i)
{
ctxs.emplace_back(name, opt->stack_size, context::POST, std::bind(&pool::main, this));
assert(opt);
ionice(ctxs.back(), opt->ionice);
nice(ctxs.back(), opt->nice);
}
}
void