mirror of
https://github.com/schoebel/mars
synced 2025-02-09 00:27:28 +00:00
infra: report global IO hangs
This commit is contained in:
parent
c1823bbfab
commit
c35065fe97
@ -63,3 +63,11 @@ int report_timing(struct timing_stats *tim, char *str, int maxlen)
|
|||||||
EXPORT_SYMBOL_GPL(report_timing);
|
EXPORT_SYMBOL_GPL(report_timing);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct threshold global_io_threshold = {
|
||||||
|
.thr_limit = 30 * 1000000, // 30 seconds
|
||||||
|
.thr_factor = 100,
|
||||||
|
.thr_plus = 0,
|
||||||
|
};
|
||||||
|
EXPORT_SYMBOL_GPL(global_io_threshold);
|
||||||
|
|
||||||
|
@ -152,6 +152,7 @@ void banning_reset(struct banning *ban)
|
|||||||
*/
|
*/
|
||||||
struct threshold {
|
struct threshold {
|
||||||
struct banning *thr_ban;
|
struct banning *thr_ban;
|
||||||
|
struct threshold *thr_parent; /* support hierarchies */
|
||||||
// tunables
|
// tunables
|
||||||
int thr_limit; // in us
|
int thr_limit; // in us
|
||||||
int thr_factor; // in %
|
int thr_factor; // in %
|
||||||
@ -164,12 +165,18 @@ struct threshold {
|
|||||||
extern inline
|
extern inline
|
||||||
void threshold_check(struct threshold *thr, long long latency)
|
void threshold_check(struct threshold *thr, long long latency)
|
||||||
{
|
{
|
||||||
if (thr->thr_limit &&
|
while (thr) {
|
||||||
latency > (long long)thr->thr_limit * 1000) {
|
if (thr->thr_limit &&
|
||||||
thr->thr_triggered++;
|
latency > (long long)thr->thr_limit * 1000) {
|
||||||
if (!banning_hit(thr->thr_ban, latency * thr->thr_factor / 100 + thr->thr_plus * 1000))
|
thr->thr_triggered++;
|
||||||
thr->thr_true_hit++;
|
if (thr->thr_ban &&
|
||||||
|
!banning_hit(thr->thr_ban, latency * thr->thr_factor / 100 + thr->thr_plus * 1000))
|
||||||
|
thr->thr_true_hit++;
|
||||||
|
}
|
||||||
|
thr = thr->thr_parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern struct threshold global_io_threshold;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -50,6 +50,7 @@ static struct timing_stats timings[3] = {};
|
|||||||
|
|
||||||
struct threshold aio_submit_threshold = {
|
struct threshold aio_submit_threshold = {
|
||||||
.thr_ban = &mars_global_ban,
|
.thr_ban = &mars_global_ban,
|
||||||
|
.thr_parent = &global_io_threshold,
|
||||||
.thr_limit = AIO_SUBMIT_MAX_LATENCY,
|
.thr_limit = AIO_SUBMIT_MAX_LATENCY,
|
||||||
.thr_factor = 10,
|
.thr_factor = 10,
|
||||||
.thr_plus = 10000,
|
.thr_plus = 10000,
|
||||||
@ -59,12 +60,14 @@ EXPORT_SYMBOL_GPL(aio_submit_threshold);
|
|||||||
struct threshold aio_io_threshold[2] = {
|
struct threshold aio_io_threshold[2] = {
|
||||||
[0] = {
|
[0] = {
|
||||||
.thr_ban = &mars_global_ban,
|
.thr_ban = &mars_global_ban,
|
||||||
|
.thr_parent = &global_io_threshold,
|
||||||
.thr_limit = AIO_IO_R_MAX_LATENCY,
|
.thr_limit = AIO_IO_R_MAX_LATENCY,
|
||||||
.thr_factor = 100,
|
.thr_factor = 100,
|
||||||
.thr_plus = 0,
|
.thr_plus = 0,
|
||||||
},
|
},
|
||||||
[1] = {
|
[1] = {
|
||||||
.thr_ban = &mars_global_ban,
|
.thr_ban = &mars_global_ban,
|
||||||
|
.thr_parent = &global_io_threshold,
|
||||||
.thr_limit = AIO_IO_W_MAX_LATENCY,
|
.thr_limit = AIO_IO_W_MAX_LATENCY,
|
||||||
.thr_factor = 100,
|
.thr_factor = 100,
|
||||||
.thr_plus = 0,
|
.thr_plus = 0,
|
||||||
|
@ -51,6 +51,7 @@ static struct timing_stats timings[2] = {};
|
|||||||
|
|
||||||
struct threshold bio_submit_threshold = {
|
struct threshold bio_submit_threshold = {
|
||||||
.thr_ban = &mars_global_ban,
|
.thr_ban = &mars_global_ban,
|
||||||
|
.thr_parent = &global_io_threshold,
|
||||||
.thr_limit = BIO_SUBMIT_MAX_LATENCY,
|
.thr_limit = BIO_SUBMIT_MAX_LATENCY,
|
||||||
.thr_factor = 100,
|
.thr_factor = 100,
|
||||||
.thr_plus = 0,
|
.thr_plus = 0,
|
||||||
@ -60,12 +61,14 @@ EXPORT_SYMBOL_GPL(bio_submit_threshold);
|
|||||||
struct threshold bio_io_threshold[2] = {
|
struct threshold bio_io_threshold[2] = {
|
||||||
[0] = {
|
[0] = {
|
||||||
.thr_ban = &mars_global_ban,
|
.thr_ban = &mars_global_ban,
|
||||||
|
.thr_parent = &global_io_threshold,
|
||||||
.thr_limit = BIO_IO_R_MAX_LATENCY,
|
.thr_limit = BIO_IO_R_MAX_LATENCY,
|
||||||
.thr_factor = 10,
|
.thr_factor = 10,
|
||||||
.thr_plus = 10000,
|
.thr_plus = 10000,
|
||||||
},
|
},
|
||||||
[1] = {
|
[1] = {
|
||||||
.thr_ban = &mars_global_ban,
|
.thr_ban = &mars_global_ban,
|
||||||
|
.thr_parent = &global_io_threshold,
|
||||||
.thr_limit = BIO_IO_W_MAX_LATENCY,
|
.thr_limit = BIO_IO_W_MAX_LATENCY,
|
||||||
.thr_factor = 10,
|
.thr_factor = 10,
|
||||||
.thr_plus = 10000,
|
.thr_plus = 10000,
|
||||||
|
@ -234,6 +234,7 @@ static
|
|||||||
ctl_table io_tuning_table[] = {
|
ctl_table io_tuning_table[] = {
|
||||||
LIMITER_ENTRIES(&global_writeback.limiter, "writeback", "kb"),
|
LIMITER_ENTRIES(&global_writeback.limiter, "writeback", "kb"),
|
||||||
INT_ENTRY("writeback_until_percent", global_writeback.until_percent, 0600),
|
INT_ENTRY("writeback_until_percent", global_writeback.until_percent, 0600),
|
||||||
|
THRESHOLD_ENTRIES(&global_io_threshold, "global_io"),
|
||||||
THRESHOLD_ENTRIES(&bio_submit_threshold, "bio_submit"),
|
THRESHOLD_ENTRIES(&bio_submit_threshold, "bio_submit"),
|
||||||
THRESHOLD_ENTRIES(&bio_io_threshold[0], "bio_io_r"),
|
THRESHOLD_ENTRIES(&bio_io_threshold[0], "bio_io_r"),
|
||||||
THRESHOLD_ENTRIES(&bio_io_threshold[1], "bio_io_w"),
|
THRESHOLD_ENTRIES(&bio_io_threshold[1], "bio_io_w"),
|
||||||
|
Loading…
Reference in New Issue
Block a user