diff options
author | Christoph Hellwig <hch@lst.de> | 2021-02-02 13:13:25 +0100 |
---|---|---|
committer | Jessica Yu <jeyu@kernel.org> | 2021-02-08 12:21:40 +0100 |
commit | a006050575745ca2be25118b90f1c37f454ac542 (patch) | |
tree | 443ebee9efd98b83825c939c1a8879613ac32561 /kernel/trace/trace_kprobe.c | |
parent | module: unexport find_module and module_mutex (diff) | |
download | linux-a006050575745ca2be25118b90f1c37f454ac542.tar.xz linux-a006050575745ca2be25118b90f1c37f454ac542.zip |
module: use RCU to synchronize find_module
Allow for a RCU-sched critical section around find_module, following
the lower level find_module_all helper, and switch the two callers
outside of module.c to use such a RCU-sched critical section instead
of module_mutex.
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Diffstat (limited to 'kernel/trace/trace_kprobe.c')
-rw-r--r-- | kernel/trace/trace_kprobe.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index e6fba1798771..3137992baa5e 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -124,9 +124,9 @@ static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk) if (!p) return true; *p = '\0'; - mutex_lock(&module_mutex); + rcu_read_lock_sched(); ret = !!find_module(tk->symbol); - mutex_unlock(&module_mutex); + rcu_read_unlock_sched(); *p = ':'; return ret; |