mbox series

[v3,00/28] module: Use RCU instead of RCU-sched.

Message ID 20250108090457.512198-1-bigeasy@linutronix.de (mailing list archive)
Headers show
Series module: Use RCU instead of RCU-sched. | expand

Message

Sebastian Sewior Jan. 8, 2025, 9:04 a.m. UTC
Hi,

This is an updated version of the initial post after PeterZ made me
aware that there are users outside of the module directory.
The goal is replace the mix auf rcu_read_lock(), rcu_read_lock_sched()
and preempt_disable() with just rcu_read_lock().

I've split it into smaller chunks which can be applied/ reviewed
independently.

v2…v3: https://lore.kernel.org/all/20241220174731.514432-1-bigeasy@linutronix.de/
  - Converted cfi to use RCU.
  - Use scoped_guard() in LoongArch's ftrace code after Steven suggested
    it.

v1…v2: https://lore.kernel.org/all/20241205215102.hRywUW2A@linutronix.de/
  - Split into smaller patches.
  - Converted all users.

Sebastian Andrzej Siewior (28):
  module: Extend the preempt disabled section in
    dereference_symbol_descriptor().
  module: Begin to move from RCU-sched to RCU.
  module: Use proper RCU assignment in add_kallsyms().
  module: Use RCU in find_kallsyms_symbol().
  module: Use RCU in module_get_kallsym().
  module: Use RCU in find_module_all().
  module: Use RCU in __find_kallsyms_symbol_value().
  module: Use RCU in module_kallsyms_on_each_symbol().
  module: Remove module_assert_mutex_or_preempt() from
    try_add_tainted_module().
  module: Use RCU in find_symbol().
  module: Use RCU in __is_module_percpu_address().
  module: Allow __module_address() to be called from RCU section.
  module: Use RCU in search_module_extables().
  module: Use RCU in all users of __module_address().
  module: Use RCU in all users of __module_text_address().
  ARM: module: Use RCU in all users of __module_text_address().
  arm64: module: Use RCU in all users of __module_text_address().
  LoongArch/orc: Use RCU in all users of __module_address().
  LoongArch: ftrace: Use RCU in all users of __module_text_address().
  powerpc/ftrace: Use RCU in all users of __module_text_address().
  cfi: Use RCU while invoking __module_address().
  x86: Use RCU in all users of __module_address().
  jump_label: Use RCU in all users of __module_address().
  jump_label: Use RCU in all users of __module_text_address().
  bpf: Use RCU in all users of __module_text_address().
  kprobes: Use RCU in all users of __module_text_address().
  static_call: Use RCU in all users of __module_text_address().
  bug: Use RCU instead RCU-sched to protect module_bug_list.

 arch/arm/kernel/module-plts.c            |   4 +-
 arch/arm64/kernel/ftrace.c               |   7 +-
 arch/loongarch/kernel/ftrace_dyn.c       |   9 +-
 arch/loongarch/kernel/unwind_orc.c       |   4 +-
 arch/powerpc/kernel/trace/ftrace.c       |   6 +-
 arch/powerpc/kernel/trace/ftrace_64_pg.c |   6 +-
 arch/x86/kernel/callthunks.c             |   3 +-
 arch/x86/kernel/unwind_orc.c             |   4 +-
 include/linux/kallsyms.h                 |   3 +-
 include/linux/module.h                   |   2 +-
 kernel/cfi.c                             |   5 +-
 kernel/jump_label.c                      |  31 ++++---
 kernel/kprobes.c                         |   4 +-
 kernel/livepatch/core.c                  |   4 +-
 kernel/module/internal.h                 |  11 ---
 kernel/module/kallsyms.c                 |  73 ++++++----------
 kernel/module/main.c                     | 103 ++++++++---------------
 kernel/module/tracking.c                 |   2 -
 kernel/module/tree_lookup.c              |   8 +-
 kernel/module/version.c                  |  14 +--
 kernel/static_call_inline.c              |  13 ++-
 kernel/trace/bpf_trace.c                 |  19 ++---
 kernel/trace/trace_kprobe.c              |   9 +-
 lib/bug.c                                |  22 ++---
 24 files changed, 136 insertions(+), 230 deletions(-)

Sebastian

Comments

Petr Pavlu Jan. 13, 2025, 11:09 a.m. UTC | #1
On 1/8/25 10:04, Sebastian Andrzej Siewior wrote:
> This is an updated version of the initial post after PeterZ made me
> aware that there are users outside of the module directory.
> The goal is replace the mix auf rcu_read_lock(), rcu_read_lock_sched()
> and preempt_disable() with just rcu_read_lock().

Thanks for this cleanup. I've queued the fix in patch #1 on
modules-fixes. For the rest, I plan to give folks more time to look at
the changes as this affects a number of subsystems. If there are no
other concerns, I'd then add the series on modules-next.
Sebastian Sewior Jan. 13, 2025, 1:23 p.m. UTC | #2
On 2025-01-13 12:09:27 [+0100], Petr Pavlu wrote:
> Thanks for this cleanup. I've queued the fix in patch #1 on
> modules-fixes. For the rest, I plan to give folks more time to look at
> the changes as this affects a number of subsystems. If there are no
> other concerns, I'd then add the series on modules-next.
Good, thanks for the update.

Sebastian