• Marco Elver's avatar
    kcsan: Rate-limit reporting per data races · 05f9a406
    Marco Elver authored
    KCSAN data-race reports can occur quite frequently, so much so as
    to render the system useless.  This commit therefore adds support for
    time-based rate-limiting KCSAN reports, with the time interval specified
    by a new KCSAN_REPORT_ONCE_IN_MS Kconfig option.  The default is 3000
    milliseconds, also known as three seconds.
    
    Because KCSAN must detect data races in allocators and in other contexts
    where use of allocation is ill-advised, a fixed-size array is used to
    buffer reports during each reporting interval.  To reduce the number of
    reports lost due to array overflow, this commit stores only one instance
    of duplicate reports, which has the benefit of further reducing KCSAN's
    console output rate.
    Reported-by: default avatarQian Cai <cai@lca.pw>
    Suggested-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    Signed-off-by: default avatarMarco Elver <elver@google.com>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    05f9a406
report.c 11.7 KB