History

completion: Use lockdep_assert_RT_in_threaded_ctx() in complete_all()

The warning was intended to spot complete_all() users from hardirq context on PREEMPT_RT. The warning as-is will also trigger in interrupt handlers, which are threaded on PREEMPT_RT, which was not intended. Use lockdep_assert_RT_in_threaded_ctx() which triggers in non-preemptive context on PREEMPT_RT.

Sebastian Siewior committed 6 years ago

Commit 8bf6c671 parent d53f2b62 files · +16 −1Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/lockdep.h+15−0
@@ -711,6 +711,21 @@ do { \ · 710 unmodified lines
711711 # define lockdep_assert_in_irq() do { } while (0)
712712 #endif
713713
714+#ifdef CONFIG_PROVE_RAW_LOCK_NESTING
715+
716+# define lockdep_assert_RT_in_threaded_ctx() do { \
717+ WARN_ONCE(debug_locks && !current->lockdep_recursion && \
718+ current->hardirq_context && \
719+ !(current->hardirq_threaded || current->irq_config), \
720+ "Not in threaded context on PREEMPT_RT as expected\n"); \
721+} while (0)
722+
723+#else
724+
725+# define lockdep_assert_RT_in_threaded_ctx() do { } while (0)
726+
727+#endif
728+
714729 #ifdef CONFIG_LOCKDEP
715730 void lockdep_rcu_suspicious(const char *file, const int line, const char *s);
716731 #else