On Mon, 28 Sep 2026 21:22:51 +0900 Masami Hiramatsu (Google) <[email protected]> wrote:
> > Hm, OK. Maybe we need to add something like checking rcu_watching, but > FTRACE_OPS_FL_RCU does not work correctly because fgraph_init_ops() only > configures subops (gops->ops). ftrace_startup_subops() does not propagete > that flag to graph_ops. (I guess that is yet another problem?) > > To guarantee no illegal RCU usage or lockdep splats if an instrumented > function returns while RCU is offline, we can check > > if (unlikely(!rcu_is_watching())) > return; If rcu isn't watching then that is a bug. If you enable CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING then the ftrace_test_recursion_trylock() tests for rcu_is_watching(). We actually had that as default for some time to trigger any ftrace calls that were outside of RCU watching and was fixed. Perhaps we need to enable that on more test machines to see if anything came back and allowed ftrace to trigger without it watching? -- Steve
