On Mon, 2 Oct 2023 at 11:09, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > > BTW, is there any reason not to have synchronize_rcu() in delete_module(2), > just before calling ->exit()? > > It's not a hot path, unless something really weird is going on, and it > would get rid of the need to delay unload_nls() calls... We already have one - it's hidden in free_module(). It's done after the kallsyms list removal. Is that too late? Note that module *loading* actually has a few other synchronize_rcu() calls in the failure path. In fact, load_module() has *two* "synchronize_rcu()" calls: - after ftrace_release_mod(mod) - before releasing module_mutex for the failure path, but there's only one for module unloading. Adding one to after ftrace_release_mod() - where we have that async_synchronize_full() - would make module unloading match the loading error path. But the synchronize_rcu calls do seem to be a bit randomly sprinkled about. Maybe the one in free_module() is already sufficient for nls? Linus