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:
parent
97b613bb82
commit
2532f7f5e2
2 changed files with 27 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue