mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG
In order to avoid WARN/BUG from generating nested or even recursive warnings, force rcu_is_watching() true during WARN/lockdep_rcu_suspicious(). Notably things like unwinding the stack can trigger rcu_dereference() warnings, which then triggers more unwinding which then triggers more warnings etc.. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20230126151323.408156109@infradead.org
This commit is contained in:
committed by
Ingo Molnar
parent
393e2ea30a
commit
5a5d7e9bad
@@ -34,6 +34,7 @@
|
||||
#include <linux/ratelimit.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/context_tracking.h>
|
||||
#include <trace/events/error_report.h>
|
||||
#include <asm/sections.h>
|
||||
|
||||
@@ -679,6 +680,7 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
|
||||
void warn_slowpath_fmt(const char *file, int line, unsigned taint,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
bool rcu = warn_rcu_enter();
|
||||
struct warn_args args;
|
||||
|
||||
pr_warn(CUT_HERE);
|
||||
@@ -693,11 +695,13 @@ void warn_slowpath_fmt(const char *file, int line, unsigned taint,
|
||||
va_start(args.args, fmt);
|
||||
__warn(file, line, __builtin_return_address(0), taint, NULL, &args);
|
||||
va_end(args.args);
|
||||
warn_rcu_exit(rcu);
|
||||
}
|
||||
EXPORT_SYMBOL(warn_slowpath_fmt);
|
||||
#else
|
||||
void __warn_printk(const char *fmt, ...)
|
||||
{
|
||||
bool rcu = warn_rcu_enter();
|
||||
va_list args;
|
||||
|
||||
pr_warn(CUT_HERE);
|
||||
@@ -705,6 +709,7 @@ void __warn_printk(const char *fmt, ...)
|
||||
va_start(args, fmt);
|
||||
vprintk(fmt, args);
|
||||
va_end(args);
|
||||
warn_rcu_exit(rcu);
|
||||
}
|
||||
EXPORT_SYMBOL(__warn_printk);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user