Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
3
-
9223372036854775807
Description
the original patches from LU-12103 has defects:
1: the array for the "useless" loop counters should have 4 elements, one for each cr value
/* cX loop didn't find blocks */
atomic64_t s_bal_cX_failed[3];
atomic64_t s_bal_cX_skipped[3];
spinlock_t s_bal_lock;
accessing the last element is almost impossible, but it is theoretically possible.
2. the output to the sysfs mb_alloc_stat file should count useless and skipped loops from 0 to 3:
seq_printf(seq, "\tuseless_c1_loops: %llu\n", (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[0])); seq_printf(seq, "\tuseless_c2_loops: %llu\n", (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[1])); seq_printf(seq, "\tuseless_c3_loops: %llu\n", (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[2])); seq_printf(seq, "\tskipped_c1_loops: %llu\n", (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[0])); seq_printf(seq, "\tskipped_c2_loops: %llu\n", (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[1])); seq_printf(seq, "\tskipped_c3_loops: %llu\n", (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[2]));
in the kernel messages, the counters named correctly:
++ "mballoc: (%lu, %lu, %lu) useless c(0,1,2) loops", ++ atomic64_read(&sbi->s_bal_cX_failed[0]), ++ atomic64_read(&sbi->s_bal_cX_failed[1]), ++ atomic64_read(&sbi->s_bal_cX_failed[2])); ++ ext4_msg(sb, KERN_INFO, ++ "mballoc: (%lu, %lu, %lu) skipped c(0,1,2) loops", ++ atomic64_read(&sbi->s_bal_cX_skipped[0]), ++ atomic64_read(&sbi->s_bal_cX_skipped[1]), ++ atomic64_read(&sbi->s_bal_cX_skipped[2]));