projects
/
nvme.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ff49f8
)
module: Use RCU in __is_module_percpu_address().
author
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 8 Jan 2025 09:04:40 +0000
(10:04 +0100)
committer
Petr Pavlu <petr.pavlu@suse.com>
Mon, 10 Mar 2025 10:54:44 +0000
(11:54 +0100)
The modules list can be accessed under RCU assumption.
Use RCU protection instead preempt_disable().
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link:
https://lore.kernel.org/r/20250108090457.512198-12-bigeasy@linutronix.de
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
kernel/module/main.c
patch
|
blob
|
history
diff --git
a/kernel/module/main.c
b/kernel/module/main.c
index af7ca713eff0a75ba3a0ee2c48be86c0a6314651..5d6f44c09bec250500d9a7b068a5d721196f2f93 100644
(file)
--- a/
kernel/module/main.c
+++ b/
kernel/module/main.c
@@
-450,8
+450,7
@@
bool __is_module_percpu_address(unsigned long addr, unsigned long *can_addr)
struct module *mod;
unsigned int cpu;
- preempt_disable();
-
+ guard(rcu)();
list_for_each_entry_rcu(mod, &modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
@@
-468,13
+467,10
@@
bool __is_module_percpu_address(unsigned long addr, unsigned long *can_addr)
per_cpu_ptr(mod->percpu,
get_boot_cpu_id());
}
- preempt_enable();
return true;
}
}
}
-
- preempt_enable();
return false;
}