0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::fs::aio: Add submit_coalesce conf item.

This commit is contained in:
Jason Volk 2019-08-15 23:57:55 -07:00
parent 97b613bb82
commit 2532f7f5e2
2 changed files with 27 additions and 1 deletions

View file

@ -35,6 +35,7 @@ namespace ircd::fs::aio
extern conf::item<bool> enable;
extern conf::item<size_t> max_events;
extern conf::item<size_t> max_submit;
extern conf::item<bool> submit_coalesce;
extern struct stats stats;
extern struct system *system;

View file

@ -65,6 +65,24 @@ ircd::fs::aio::max_submit
{ "persist", false },
};
decltype(ircd::fs::aio::submit_coalesce)
ircd::fs::aio::submit_coalesce
{
{ "name", "ircd.fs.aio.submit.coalesce" },
{ "default", true },
{ "description",
R"(
Enable coalescing to briefly delay the submission of a request, under
certain conditions, allowing other contexts to submit additional requests.
All requests are submitted to the kernel at once, allowing the disk
controller to plot the most efficient route of the head to satisfy all
requests with the lowest overall latency. Users with SSD's do not require
this and latency may be improved by setting it to false, though, there is
a counter-benefit by increasing system call overhead.
)"}
};
//
// init
//
@ -789,8 +807,15 @@ ircd::fs::aio::system::submit(request &request)
// and be submitted itself as well.
const bool submit_now
{
// By default a request is not submitted to the kernel immediately
// to benefit from coalescing unless one of the conditions is met.
false
// Submission coalescing is disabled by the configuration
|| !aio::submit_coalesce
// The nodelay flag is set by the user.
request.opts->nodelay
|| request.opts->nodelay
// The queue has reached its limits.
|| qcount >= max_submit()