geom_io: Shift to pause_sbt to eliminate bogus min and update comment.
Update to eliminate bogus min to ensure 0 was never passed to pause. Instead, requrest 1ms with an 'infinite' precision, which defaults to whatever the underlying time counter can do. This should ensure we run fairly quickly to start processing done events, while still giving a small pause for the system to catch its breath. This rate limiter still is less than ideal, and this commit doesn't change that. It should really have no functional change: it just uses a better interface to express the desired sleep. Sponsored by: Netflix Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45316
This commit is contained in:
+12
-15
@@ -809,20 +809,17 @@ g_io_schedule_down(struct thread *tp __unused)
|
|||||||
biotrack(bp, __func__);
|
biotrack(bp, __func__);
|
||||||
if (pace != 0) {
|
if (pace != 0) {
|
||||||
/*
|
/*
|
||||||
* There has been at least one memory allocation
|
* There has been at least one memory allocation failure
|
||||||
* failure since the last I/O completed. Pause 1ms to
|
* since the last I/O completed. Pause 1ms to give the
|
||||||
* give the system a chance to free up memory. We only
|
* system a chance to free up memory. Pause time is not
|
||||||
* do this once because a large number of allocations
|
* scaled to the number of I/O failures since they tend
|
||||||
* can fail in the direct dispatch case and there's no
|
* to cluster and the number is not predictive of how
|
||||||
* relationship between the number of these failures and
|
* long a pause is needed.
|
||||||
* the length of the outage. If there's still an outage,
|
*
|
||||||
* we'll pause again and again until it's
|
* Older versions had a longer pause, which limited the
|
||||||
* resolved. Older versions paused longer and once per
|
* IOPS to 10, which prolonged memory shortages that could
|
||||||
* allocation failure. This was OK for a single threaded
|
* be alleviated by I/O completing since it eliminated
|
||||||
* g_down, but with direct dispatch would lead to max of
|
* direct dispatch as well.
|
||||||
* 10 IOPs for minutes at a time when transient memory
|
|
||||||
* issues prevented allocation for a batch of requests
|
|
||||||
* from the upper layers.
|
|
||||||
*
|
*
|
||||||
* XXX This pacing is really lame. It needs to be solved
|
* XXX This pacing is really lame. It needs to be solved
|
||||||
* by other methods. This is OK only because the worst
|
* by other methods. This is OK only because the worst
|
||||||
@@ -833,7 +830,7 @@ g_io_schedule_down(struct thread *tp __unused)
|
|||||||
*/
|
*/
|
||||||
CTR0(KTR_GEOM, "g_down pacing self");
|
CTR0(KTR_GEOM, "g_down pacing self");
|
||||||
pause_count++; /* g_down has only one thread */
|
pause_count++; /* g_down has only one thread */
|
||||||
pause("g_down", min(hz/1000, 1));
|
pause_sbt("g_down", SBT_1MS, 0, 0);
|
||||||
pace = 0;
|
pace = 0;
|
||||||
}
|
}
|
||||||
CTR2(KTR_GEOM, "g_down processing bp %p provider %s", bp,
|
CTR2(KTR_GEOM, "g_down processing bp %p provider %s", bp,
|
||||||
|
|||||||
Reference in New Issue
Block a user