infra: report global IO hangs

This commit is contained in:
Thomas Schoebel-Theuer 2015-02-10 11:33:20 +01:00
parent c1823bbfab
commit c35065fe97
5 changed files with 27 additions and 5 deletions

View File

@ -63,3 +63,11 @@ int report_timing(struct timing_stats *tim, char *str, int maxlen)
EXPORT_SYMBOL_GPL(report_timing);
#endif
struct threshold global_io_threshold = {
.thr_limit = 30 * 1000000, // 30 seconds
.thr_factor = 100,
.thr_plus = 0,
};
EXPORT_SYMBOL_GPL(global_io_threshold);

View File

@ -152,6 +152,7 @@ void banning_reset(struct banning *ban)
*/
struct threshold {
struct banning *thr_ban;
struct threshold *thr_parent; /* support hierarchies */
// tunables
int thr_limit; // in us
int thr_factor; // in %
@ -164,12 +165,18 @@ struct threshold {
extern inline
void threshold_check(struct threshold *thr, long long latency)
{
if (thr->thr_limit &&
latency > (long long)thr->thr_limit * 1000) {
thr->thr_triggered++;
if (!banning_hit(thr->thr_ban, latency * thr->thr_factor / 100 + thr->thr_plus * 1000))
thr->thr_true_hit++;
while (thr) {
if (thr->thr_limit &&
latency > (long long)thr->thr_limit * 1000) {
thr->thr_triggered++;
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

View File

@ -50,6 +50,7 @@ static struct timing_stats timings[3] = {};
struct threshold aio_submit_threshold = {
.thr_ban = &mars_global_ban,
.thr_parent = &global_io_threshold,
.thr_limit = AIO_SUBMIT_MAX_LATENCY,
.thr_factor = 10,
.thr_plus = 10000,
@ -59,12 +60,14 @@ EXPORT_SYMBOL_GPL(aio_submit_threshold);
struct threshold aio_io_threshold[2] = {
[0] = {
.thr_ban = &mars_global_ban,
.thr_parent = &global_io_threshold,
.thr_limit = AIO_IO_R_MAX_LATENCY,
.thr_factor = 100,
.thr_plus = 0,
},
[1] = {
.thr_ban = &mars_global_ban,
.thr_parent = &global_io_threshold,
.thr_limit = AIO_IO_W_MAX_LATENCY,
.thr_factor = 100,
.thr_plus = 0,

View File

@ -51,6 +51,7 @@ static struct timing_stats timings[2] = {};
struct threshold bio_submit_threshold = {
.thr_ban = &mars_global_ban,
.thr_parent = &global_io_threshold,
.thr_limit = BIO_SUBMIT_MAX_LATENCY,
.thr_factor = 100,
.thr_plus = 0,
@ -60,12 +61,14 @@ EXPORT_SYMBOL_GPL(bio_submit_threshold);
struct threshold bio_io_threshold[2] = {
[0] = {
.thr_ban = &mars_global_ban,
.thr_parent = &global_io_threshold,
.thr_limit = BIO_IO_R_MAX_LATENCY,
.thr_factor = 10,
.thr_plus = 10000,
},
[1] = {
.thr_ban = &mars_global_ban,
.thr_parent = &global_io_threshold,
.thr_limit = BIO_IO_W_MAX_LATENCY,
.thr_factor = 10,
.thr_plus = 10000,

View File

@ -234,6 +234,7 @@ static
ctl_table io_tuning_table[] = {
LIMITER_ENTRIES(&global_writeback.limiter, "writeback", "kb"),
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_io_threshold[0], "bio_io_r"),
THRESHOLD_ENTRIES(&bio_io_threshold[1], "bio_io_w"),