Re: [PATCH v2] module: Make sure relocations are applied to the per-CPU section

2025-06-10 Thread Sebastian Andrzej Siewior
On 2025-06-05 18:50:27 [+0200], Petr Pavlu wrote: > On 6/5/25 5:54 PM, Sebastian Andrzej Siewior wrote: > > On 2025-06-05 15:44:23 [+0200], Petr Pavlu wrote: > >> Isn't this broken earlier by "Don't relocate non-allocated regions in > >> modules."

Re: [PATCH v2] module: Make sure relocations are applied to the per-CPU section

2025-06-05 Thread Sebastian Andrzej Siewior
On 2025-06-05 15:44:23 [+0200], Petr Pavlu wrote: > Isn't this broken earlier by "Don't relocate non-allocated regions in > modules." > (pre-Git, [1])? Looking further back into the history, we have 21af2f0289dea ("[PATCH] per-cpu support inside modules (minimal)") which does + if

[PATCH v2] module: Make sure relocations are applied to the per-CPU section

2025-06-04 Thread Sebastian Andrzej Siewior
e4f7d-...@intel.com Fixes: 8d8022e8aba85 ("module: do percpu allocation after uniqueness check. No, really!") Signed-off-by: Sebastian Andrzej Siewior --- v1…v2: https://lore.kernel.org/all/20250604152707.cied9...@linutronix.de/ - Add the flag back only on SMP if the per-CPU section was

[PATCH] module: Make sure relocations are applied to the per-CPU section

2025-06-04 Thread Sebastian Andrzej Siewior
e4f7d-...@intel.com Fixes: 8d8022e8aba85 ("module: do percpu allocation after uniqueness check. No, really!") Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/module/main.c b/kernel/module/main.c inde

Re: [PATCH][next] selftests/futex: Fix spelling mistake "unitiliazed" -> "uninitialized"

2025-05-20 Thread Sebastian Andrzej Siewior
On 2025-05-20 09:06:57 [+0100], Colin Ian King wrote: > There is a spelling mistake in a fail error message. Fix it. > > Signed-off-by: Colin Ian King Reviewed-by: Sebastian Andrzej Siewior Sebastian

[PATCH v2] sched,livepatch: Untangle cond_resched() and live-patching

2025-05-09 Thread Sebastian Andrzej Siewior
state. Compile tested only. [bigeasy: use likely() in __klp_sched_try_switch() and update comments] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- v1…v2: https://lore.kernel.org/all/20250324134909.ga14...@noisy.programming.kicks-ass.net/ - Updated

Re: [PATCH v3 15/28] module: Use RCU in all users of __module_text_address().

2025-04-24 Thread Sebastian Andrzej Siewior
On 2025-04-23 11:16:49 [-0700], Paul E. McKenney wrote: > On Wed, Apr 23, 2025 at 05:17:31PM +0200, Benjamin Berg wrote: > > Hi, > > > > On Wed, 2025-01-08 at 10:04 +0100, Sebastian Andrzej Siewior wrote: > > > __module_text_address() can be invoked wit

Re: [PATCH v2 04/12] rcutorture: Make torture.sh --do-rt use CONFIG_PREEMPT_RT

2025-04-05 Thread Sebastian Andrzej Siewior
t matter for testing. You do set rcupdate.rcu_normal and rcupdate.rcu_expedited but RT has rcu_normal_after_boot set by default. Not sure if this makes any difference but I *think* that normal wins here. > Signed-off-by: Paul E. McKenney > Cc: Sebastian Andrzej Siewior Sebastian

Re: [PATCH v2 0/4] tools/nolibc: MIPS: entrypoint cleanups and N32/N64 ABIs

2025-03-30 Thread Sebastian Andrzej Siewior
On 2025-03-29 10:51:47 [+0100], Thomas Weißschuh wrote: > > Does the following work for you when running kust "make nolibc-test"? I had to manually apply this on top of b4/nolibc-mips-n32. The resulting make produced the native 64bit binary. Sebastian

Re: [PATCH v2 0/4] tools/nolibc: MIPS: entrypoint cleanups and N32/N64 ABIs

2025-03-26 Thread Sebastian Andrzej Siewior
On 2025-03-26 22:51:54 [+0100], Thomas Weißschuh wrote: > > mips32le works as-is. > > For mips64le I had to s/-march=mips64r6/-march=mips64r2 to match the > > ABI. Which makes me wonder: Why do do we need to pass -march here and > > can't rely on toolchain defaults? > > The goal here is to have an

Re: [PATCH v2 0/4] tools/nolibc: MIPS: entrypoint cleanups and N32/N64 ABIs

2025-03-26 Thread Sebastian Andrzej Siewior
On 2025-02-25 18:02:34 [+0100], Thomas Weißschuh wrote: > Introduce support for the N32 and N64 ABIs. As preparation, the > entrypoint is first simplified significantly. Thanks to Maciej for all > the valuable information. > > Signed-off-by: Thomas Weißschuh Tested-by: Sebastian

Re: [PATCH v2] tools/nolibc: Add support for SPARC

2025-03-22 Thread Sebastian Andrzej Siewior
On 2025-03-22 09:10:51 [+0100], Thomas Weißschuh wrote: > Tested-by: Sebastian Andrzej Siewior # UltraSparc > T4 (Niagara4) > --- > This is only tested on QEMU. > Any tests on real hardware would be very welcome. I did test on real hardware. Sebastian

Re: [PATCH RFC v2 03/10] locking/local_lock: Introduce localtry_lock_t

2025-02-17 Thread Sebastian Andrzej Siewior
e there is no need to use local_inc for acquired variable, > >> since it's a percpu variable with strict nesting scopes. > >> > >> Signed-off-by: Sebastian Andrzej Siewior > >> Signed-off-by: Alexei Starovoitov > >> Signed-off-by: Vlastimil B

Re: [PATCH RFC v2 03/10] locking/local_lock: Introduce localtry_lock_t

2025-02-17 Thread Sebastian Andrzej Siewior
On 2025-02-14 17:27:39 [+0100], Vlastimil Babka wrote: > From: Sebastian Andrzej Siewior > > In !PREEMPT_RT local_lock_irqsave() disables interrupts to protect > critical section, but it doesn't prevent NMI, so the fully reentrant > code cannot use local_lock_irqsave()

Re: [PATCH 0/4] ucount: Simplify refcounting with rcuref_t.

2025-02-07 Thread Sebastian Andrzej Siewior
On 2025-02-03 16:05:21 [+0100], To linux-kernel@vger.kernel.org wrote: > I noticed that the atomic_dec_and_lock_irqsave() in put_ucounts() loops > sometimes even during boot. Something like 2-3 iterations but still. > This series replaces the refcounting with rcuref_t and adds a RCU > lookup. > Thi

[PATCH 3/4] ucount: Use RCU for ucounts lookups.

2025-02-03 Thread Sebastian Andrzej Siewior
section and return the item if a reference could be obtained. This means alloc_ucounts() will always return an element (unless the memory allocation failed). Let put_ucounts() RCU free the element if the reference counter dropped to zero. Signed-off-by: Sebastian Andrzej Siewior --- include/linux

[PATCH 0/4] ucount: Simplify refcounting with rcuref_t.

2025-02-03 Thread Sebastian Andrzej Siewior
cmpxchg()less put of the item. Patch #1 adds HLIST_NULLS_HEAD_INIT for which I added the RCU folks. Sebastian Sebastian Andrzej Siewior (4): rcu: Provide a static initializer for hlist_nulls_head. ucount: Replace get_ucounts_or_wrap() with atomic_inc_not_zero(). ucount: Use RCU for ucounts

[PATCH 4/4] ucount: Use rcuref_t for reference counting.

2025-02-03 Thread Sebastian Andrzej Siewior
-off-by: Sebastian Andrzej Siewior --- include/linux/user_namespace.h | 11 +-- kernel/ucount.c| 16 +--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index ad4dbef92597b

[PATCH 1/4] rcu: Provide a static initializer for hlist_nulls_head.

2025-02-03 Thread Sebastian Andrzej Siewior
Provide a static initializer for hlist_nulls_head so that it can be used in statically defined data structures. Signed-off-by: Sebastian Andrzej Siewior --- include/linux/list_nulls.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h

[PATCH 2/4] ucount: Replace get_ucounts_or_wrap() with atomic_inc_not_zero().

2025-02-03 Thread Sebastian Andrzej Siewior
Andrzej Siewior --- kernel/ucount.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/kernel/ucount.c b/kernel/ucount.c index 86c5f1c0bad90..4aa5011538257 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -146,25 +146,16 @@ static void

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

2025-01-29 Thread Sebastian Andrzej Siewior
On 2025-01-27 13:22:17 [+0100], Petr Pavlu wrote: > On 1/24/25 18:49, Sebastian Andrzej Siewior wrote: > > 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

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

2025-01-24 Thread Sebastian Andrzej Siewior
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

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

2025-01-13 Thread Sebastian Andrzej Siewior
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

Re: [PATCH v3 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().

2025-01-08 Thread Sebastian Andrzej Siewior
On 2025-01-08 10:55:04 [+0100], Helge Deller wrote: > Nice catch. > > Acked-by: Helge Deller > > This patch really should be backported. > Can you add a Cc: stable tag? It should be picked due to the fixes tag. I add it if I am going to repost it. > Helge Sebastian

[PATCH v3 28/28] bug: Use RCU instead RCU-sched to protect module_bug_list.

2025-01-08 Thread Sebastian Andrzej Siewior
Intel) Signed-off-by: Sebastian Andrzej Siewior --- lib/bug.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/bug.c b/lib/bug.c index e0ff219899902..b1f07459c2ee3 100644 --- a/lib/bug.c +++ b/lib/bug.c @@ -66,23 +66,19 @@ static LIST_HEAD(module_bug

[PATCH v3 03/28] module: Use proper RCU assignment in add_kallsyms().

2025-01-08 Thread Sebastian Andrzej Siewior
stian Andrzej Siewior --- kernel/module/kallsyms.c | 31 ++- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c index bf65e0c3c86fc..45846ae4042d1 100644 --- a/kernel/module/kallsyms.c +++ b/kernel/module/kalls

[PATCH v3 09/28] module: Remove module_assert_mutex_or_preempt() from try_add_tainted_module().

2025-01-08 Thread Sebastian Andrzej Siewior
Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/tracking.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c index 16742d1c630c6..4fefec5b683c6 100644 --- a/kernel/module/tracking.c +++ b/kernel/module/tracking.c

[PATCH v3 21/28] cfi: Use RCU while invoking __module_address().

2025-01-08 Thread Sebastian Andrzej Siewior
RCU. Cc: Elliot Berman Cc: Kees Cook Cc: Nathan Chancellor Cc: Sami Tolvanen Cc: Steven Rostedt Cc: l...@lists.linux.dev Tested-by: Elliot Berman # sm8650-qrd Link: https://lore.kernel.org/all/20241230185812429-0800.eber...@hu-eberman-lv.qualcomm.com Acked-by: Peter Zijlstra (Intel) Signed

[PATCH v3 24/28] jump_label: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/jump_label.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/kernel/jump_label.c b/kernel/jump_label.c index 7fcf4017cb383..7cb19e6014266 100644 --- a/kernel/jump_label.c +++ b/kernel

[PATCH v3 27/28] static_call: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel

[PATCH v3 22/28] x86: Use RCU in all users of __module_address().

2025-01-08 Thread Sebastian Andrzej Siewior
Cc: Thomas Gleixner Cc: x...@kernel.org Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/kernel/callthunks.c | 3 +-- arch/x86/kernel/unwind_orc.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/callthunks.c b/arch

[PATCH v3 23/28] jump_label: Use RCU in all users of __module_address().

2025-01-08 Thread Sebastian Andrzej Siewior
Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/jump_label.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/jump_label.c b/kernel/jump_label.c index 93a822d3c468c..7fcf4017cb383 100644 --- a/kernel/jump_label.c +++ b/kernel

[PATCH v3 18/28] LoongArch/orc: Use RCU in all users of __module_address().

2025-01-08 Thread Sebastian Andrzej Siewior
: Sebastian Andrzej Siewior --- arch/loongarch/kernel/unwind_orc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/loongarch/kernel/unwind_orc.c b/arch/loongarch/kernel/unwind_orc.c index b257228763317..d623935a75471 100644 --- a/arch/loongarch/kernel/unwind_orc.c +++ b

[PATCH v3 16/28] ARM: module: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
-by: Sebastian Andrzej Siewior --- arch/arm/kernel/module-plts.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c index da2ee8d6ef1a7..354ce16d83cb5 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel

[PATCH v3 14/28] module: Use RCU in all users of __module_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_address() with RCU. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- include/linux/kallsyms.h | 3

[PATCH v3 15/28] module: Use RCU in all users of __module_text_address().

2025-01-08 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c

[PATCH v3 13/28] module: Use RCU in search_module_extables().

2025-01-08 Thread Sebastian Andrzej Siewior
sufficient. Therefore it is safe to return the exception_table_entry outside the RCU section which provided the module. Use RCU for the lookup in search_module_extables() and update the comment. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/m

[PATCH v3 08/28] module: Use RCU in module_kallsyms_on_each_symbol().

2025-01-08 Thread Sebastian Andrzej Siewior
module::kallsyms can be accessed under RCU assumption. Use rcu_dereference() to access module::kallsyms. Update callers. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

[PATCH v3 10/28] module: Use RCU in find_symbol().

2025-01-08 Thread Sebastian Andrzej Siewior
find_symbol() and update callers. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c| 30 -- kernel/module/version.c | 14 +++--- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/kernel/module

[PATCH v3 12/28] module: Allow __module_address() to be called from RCU section.

2025-01-08 Thread Sebastian Andrzej Siewior
the last user. Update comments. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/internal.h | 11 --- kernel/module/main.c | 4 +--- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/kernel/module/internal.h b/kernel/module

[PATCH v3 11/28] module: Use RCU in __is_module_percpu_address().

2025-01-08 Thread Sebastian Andrzej Siewior
The modules list can be accessed under RCU assumption. Use RCU protection instead preempt_disable(). Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/module/main.c

[PATCH v3 07/28] module: Use RCU in __find_kallsyms_symbol_value().

2025-01-08 Thread Sebastian Andrzej Siewior
module::kallsyms can be accessed under RCU assumption. Use rcu_dereference() to access module::kallsyms. Update callers. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 17 - 1 file changed, 4 insertions(+), 13 deletions

[PATCH v3 04/28] module: Use RCU in find_kallsyms_symbol().

2025-01-08 Thread Sebastian Andrzej Siewior
() due to __module_address(). Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c index 45846ae4042d1..3f59d04795572 100644

[PATCH v3 02/28] module: Begin to move from RCU-sched to RCU.

2025-01-08 Thread Sebastian Andrzej Siewior
ronize_rcu() in do_free_init(). That means A RCU read lock is enough for protection and rcu_dereference() can be safely used. Convert module code and its users step by step. Update comments and convert print_modules() to use RCU. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian

[PATCH v3 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().

2025-01-08 Thread Sebastian Andrzej Siewior
lerman Cc: Naveen N Rao Cc: Nicholas Piggin Cc: Sergey Senozhatsky Cc: linux-par...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Reviewed-by: Sergey Senozhatsky Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- include/linux/kallsyms.h | 2 +- 1 file

[PATCH v3 05/28] module: Use RCU in module_get_kallsym().

2025-01-08 Thread Sebastian Andrzej Siewior
The modules list and module::kallsyms can be accessed under RCU assumption. Iterate the modules with RCU protection, use rcu_dereference() to access the kallsyms pointer. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 6 ++ 1 file

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

2025-01-08 Thread Sebastian Andrzej Siewior
5102.hrywu...@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(). m

Re: [PATCH v2 00/28] module: Use RCU instead of RCU-sched.

2025-01-07 Thread Sebastian Andrzej Siewior
On 2025-01-02 13:47:06 [+0100], Christophe Leroy wrote: > Hi Sebastian, Hi Christophe, > How did you generate that cover letter ? > > It should contain the full list of files modified by the series, so that I > can see if any of them is of interest to me without going into each patch. > > This i

Re: [PATCH v2 28/28] cfi: Use RCU while invoking __module_address().

2025-01-07 Thread Sebastian Andrzej Siewior
On 2025-01-06 13:24:28 [-0800], Sami Tolvanen wrote: > Hi, Hi, > OK, great. That makes sense. Thanks for taking the time to test this! Thank you two for testing, confirming and adding more informations to what and why. I take some of this for the patch description. > Sami Sebastian

[PATCH v2 11/28] module: Use RCU in __is_module_percpu_address().

2024-12-20 Thread Sebastian Andrzej Siewior
The modules list can be accessed under RCU assumption. Use RCU protection instead preempt_disable(). Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index

[PATCH v2 13/28] module: Use RCU in search_module_extables().

2024-12-20 Thread Sebastian Andrzej Siewior
sufficient. Therefore it is safe to return the exception_table_entry outside the RCU section which provided the module. Use RCU for the lookup in search_module_extables() and update the comment. Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c | 23 +-- 1 file

[PATCH v2 04/28] module: Use RCU in find_kallsyms_symbol().

2024-12-20 Thread Sebastian Andrzej Siewior
() due to __module_address(). Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c index 45846ae4042d1..3f59d04795572 100644 --- a/kernel/module/kallsyms.c

[PATCH v2 26/28] static_call: Use RCU in all users of __module_text_address().

2024-12-20 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Signed-off-by: Sebastian Andrzej Siewior --- kernel/static_call_inline.c | 13 ++--- 1 file

[PATCH v2 18/28] LoongArch/orc: Use RCU in all users of __module_address().

2024-12-20 Thread Sebastian Andrzej Siewior
__module_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_address() with RCU. Cc: Huacai Chen Cc: WANG Xuerui Cc: loonga...@lists.linux.dev Signed-off-by: Sebastian Andrzej Siewior

[PATCH v2 14/28] module: Use RCU in all users of __module_address().

2024-12-20 Thread Sebastian Andrzej Siewior
__module_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_address() with RCU. Signed-off-by: Sebastian Andrzej Siewior --- include/linux/kallsyms.h | 3 +-- kernel/module/kallsyms.c | 5

[PATCH v2 00/28] module: Use RCU instead of RCU-sched.

2024-12-20 Thread Sebastian Andrzej Siewior
Hi, This is an updated version of the inital 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 splitted it into smaller chunks which can

[PATCH v2 12/28] module: Allow __module_address() to be called from RCU section.

2024-12-20 Thread Sebastian Andrzej Siewior
the last user. Update comments. Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/internal.h | 11 --- kernel/module/main.c | 4 +--- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/kernel/module/internal.h b/kernel/module/internal.h index daef2be839022

[PATCH v2 07/28] module: Use RCU in __find_kallsyms_symbol_value().

2024-12-20 Thread Sebastian Andrzej Siewior
module::kallsyms can be accessed under RCU assumption. Use rcu_dereference() to access module::kallsyms. Update callers. Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/kernel/module

[PATCH v2 08/28] module: Use RCU in module_kallsyms_on_each_symbol().

2024-12-20 Thread Sebastian Andrzej Siewior
module::kallsyms can be accessed under RCU assumption. Use rcu_dereference() to access module::kallsyms. Update callers. Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/module/kallsyms.c b

[PATCH v2 16/28] ARM: module: Use RCU in all users of __module_text_address().

2024-12-20 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Sebastian Andrzej Siewior

[PATCH v2 28/28] cfi: Use RCU while invoking __module_address().

2024-12-20 Thread Sebastian Andrzej Siewior
erman Cc: Kees Cook Cc: Nathan Chancellor Cc: Sami Tolvanen Cc: Steven Rostedt Cc: l...@lists.linux.dev Signed-off-by: Sebastian Andrzej Siewior --- kernel/cfi.c | 4 1 file changed, 4 insertions(+) diff --git a/kernel/cfi.c b/kernel/cfi.c index 08caad7767176..c8f2b5a51b2e6 100644 ---

[PATCH v2 27/28] bug: Use RCU instead RCU-sched to protect module_bug_list.

2024-12-20 Thread Sebastian Andrzej Siewior
The list module_bug_list relies on module_mutex for writer synchronisation. The list is already RCU style. The list removal is synchronized with modules' synchronize_rcu() in free_module(). Use RCU read lock protection instead of RCU-sched. Cc: Andrew Morton Signed-off-by: Sebastian An

[PATCH v2 23/28] jump_label: Use RCU in all users of __module_text_address().

2024-12-20 Thread Sebastian Andrzej Siewior
-off-by: Sebastian Andrzej Siewior --- kernel/jump_label.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/kernel/jump_label.c b/kernel/jump_label.c index 7fcf4017cb383..7cb19e6014266 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c @@ -653,13 +653,12

[PATCH v2 22/28] jump_label: Use RCU in all users of __module_address().

2024-12-20 Thread Sebastian Andrzej Siewior
: Sebastian Andrzej Siewior --- kernel/jump_label.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/jump_label.c b/kernel/jump_label.c index 93a822d3c468c..7fcf4017cb383 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c @@ -746,9 +746,9 @@ static

[PATCH v2 21/28] x86: Use RCU in all users of __module_address().

2024-12-20 Thread Sebastian Andrzej Siewior
Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: x...@kernel.org Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/kernel/callthunks.c | 3 +-- arch/x86/kernel/unwind_orc.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/callthunks.c b/arch/x86/kernel/callthun

[PATCH v2 15/28] module: Use RCU in all users of __module_text_address().

2024-12-20 Thread Sebastian Andrzej Siewior
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c | 16 +--- 1 file

[PATCH v2 09/28] module: Remove module_assert_mutex_or_preempt() from try_add_tainted_module().

2024-12-20 Thread Sebastian Andrzej Siewior
: Sebastian Andrzej Siewior --- kernel/module/tracking.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c index 16742d1c630c6..4fefec5b683c6 100644 --- a/kernel/module/tracking.c +++ b/kernel/module/tracking.c @@ -21,8 +21,6 @@ int

[PATCH v2 10/28] module: Use RCU in find_symbol().

2024-12-20 Thread Sebastian Andrzej Siewior
find_symbol() and update callers. Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c| 30 -- kernel/module/version.c | 14 +++--- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/kernel/module/main.c b/kernel/module/main.c index

[PATCH v2 05/28] module: Use RCU in module_get_kallsym().

2024-12-20 Thread Sebastian Andrzej Siewior
The modules list and module::kallsyms can be accessed under RCU assumption. Iterate the modules with RCU protection, use rcu_dereference() to access the kallsyms pointer. Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/kallsyms.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH v2 02/28] module: Begin to move from RCU-sched to RCU.

2024-12-20 Thread Sebastian Andrzej Siewior
ronize_rcu() in do_free_init(). That means A RCU read lock is enough for protection and rcu_dereference() can be safely used. Convert module code and its users step by step. Update comments and convert print_modules() to use RCU. Signed-off-by: Sebastian Andrzej Siewior --- kernel/module/main.c

[PATCH v2 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().

2024-12-20 Thread Sebastian Andrzej Siewior
Cc: Michael Ellerman Cc: Naveen N Rao Cc: Nicholas Piggin Cc: Sergey Senozhatsky Cc: linux-par...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Signed-off-by: Sebastian Andrzej Siewior --- include/linux/kallsyms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includ

[PATCH v2 03/28] module: Use proper RCU assignment in add_kallsyms().

2024-12-20 Thread Sebastian Andrzej Siewior
o use rcu_dereference() here, it is just to keep checkers quiet. The whole RCU read section is also not needed. Use a local kallsyms pointer and setup the data structures. Assign that pointer to the data structure at the end via rcu_assign_pointer(). Signed-off-by: Sebastian Andrzej Siewior --- kernel/m

Re: [PATCH] preempt: Move PREEMPT_RT before PREEMPT in vermagic.

2024-12-10 Thread Sebastian Andrzej Siewior
On 2024-12-10 14:52:23 [+0100], Petr Pavlu wrote: > > Reviewed-by: Petr Pavlu > > I'm going to wait for a few days if others want to comment and then plan > to take this through the modules tree for 6.13-rcX fixes. thank you. > [Luis asked me to look after the modules tree for a while, with th

[PATCH] preempt: Move PREEMPT_RT before PREEMPT in vermagic.

2024-12-05 Thread Sebastian Andrzej Siewior
both symbols are enabled. Fixes: 35772d627b55c ("sched: Enable PREEMPT_DYNAMIC for PREEMPT_RT") Signed-off-by: Sebastian Andrzej Siewior --- include/linux/vermagic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/vermagic.h b/include/linux/

Re: RE: [RT,1/1] tty/serial/sifive: Make the locking RT aware

2024-12-05 Thread Sebastian Andrzej Siewior
On 2024-12-04 15:24:38 [+], EnDe Tan wrote: > > -Original Message- > > You need to state which kernel this needs to be applied to. > > The change you looking for is > > 32c694ec3efc2 ("serial: sifive: Use uart_prepare_sysrq_char() to > > handle sysrq.") > > Thanks for pointing this

Re: [linus:master] [sched, x86] 476e8583ca: WARNING:at_kernel/rcu/update.c:#torture_sched_setaffinity

2024-11-26 Thread Sebastian Andrzej Siewior
On 2024-11-25 22:29:09 [+0800], kernel test robot wrote: > Hello, Hi, > by this commit, we see the config has below diff: > > --- > /pkg/linux/x86_64-randconfig-161-20241120/gcc-12/35772d627b55cc7fb4f33bae57c564a25b3121a9/.config >2024-11-22 17:03:32.458344665 +0800 > +++ > /pkg/linux/x86_6

[PATCH v2] kasan: Make kasan_record_aux_stack_noalloc() the default behaviour

2024-11-22 Thread Sebastian Andrzej Siewior
quot;kasan: generic: introduce kasan_record_aux_stack_noalloc()") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- v1…v2: - Renamed the patch as per Marco. - Added comment to kasan_record_aux_stack() as per Andrey. - Added fixes tag since Waiman that it is the only use

Re: [PATCH] kasan: Remove kasan_record_aux_stack_noalloc().

2024-11-22 Thread Sebastian Andrzej Siewior
On 2024-11-22 16:01:29 [+0100], Marco Elver wrote: > > Do we need to update the comment saying that it must not be used from > > NMI or do we make it jump over the locked section in the NMI case? > > Good point. It was meant to also be usable from NMI, because it's very > likely to succeed, and sh

Re: [PATCH] kasan: Remove kasan_record_aux_stack_noalloc().

2024-11-22 Thread Sebastian Andrzej Siewior
On 2024-11-19 20:36:56 [+0100], Andrey Konovalov wrote: > > diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c > > index 6310a180278b6..b18b5944997f8 100644 > > --- a/mm/kasan/generic.c > > +++ b/mm/kasan/generic.c > > @@ -521,7 +521,7 @@ size_t kasan_metadata_size(struct kmem_cache *cache, > >

[PATCH] kasan: Remove kasan_record_aux_stack_noalloc().

2024-11-19 Thread Sebastian Andrzej Siewior
://lore.kernel.org/all/67275485.050a0220.3c8d68.0a37@google.com Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- Didn't add a Fixes tag, didn't want to put 7cb3007ce2da2 ("kasan: generic: introduce kasan_record_aux_stack_noalloc()"

Re: [syzbot] [mm?] WARNING: locking bug in __rmqueue_pcplist

2024-11-13 Thread Sebastian Andrzej Siewior
On 2024-11-04 12:47:26 [+0100], Peter Zijlstra wrote: > On Mon, Nov 04, 2024 at 12:45:06PM +0100, Peter Zijlstra wrote: > > diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c > > index 6310a180278b..ac9f6682bb2f 100644 > > --- a/mm/kasan/generic.c > > +++ b/mm/kasan/generic.c > > @@ -521,12 +521,

[PATCH v3 2/3] timers: Use __raise_softirq_irqoff() to raise the softirq.

2024-11-06 Thread Sebastian Andrzej Siewior
softirq. Reviewed-by: Frederic Weisbecker Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 0fc9d066a7be4..1759de934284c 100644 --- a/kernel/time/timer.c +++ b/kernel

[PATCH v3 1/3] hrtimer: Use __raise_softirq_irqoff() to raise the softirq.

2024-11-06 Thread Sebastian Andrzej Siewior
Weisbecker Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/hrtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index cddcd08ea827f..5402e0f242178 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c

[PATCH v3 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-11-06 Thread Sebastian Andrzej Siewior
x by introduction of local_timers_pending() for tick_nohz_next_event() ] [ junxiao.ch...@intel.com: Ensure ktimersd gets woken up even if a softirq is currently served. ] Reviewed-by: Paul E. McKenney [rcutorture] Reviewed-by: Frederic Weisbecker Signed-off-by: Sebastian Andrzej Siewior

PATCH v3 0/3] softirq: Use a dedicated thread for timer wakeups with forced-threading.

2024-11-06 Thread Sebastian Andrzej Siewior
Hi, the following was in the PREEMPT_RT queue since last softirq rework. The result is that timer wake ups (hrtimer, timer_list) happens in hardirq processing them requires to wake ksoftirqd. ksoftirqd runs at SCHED_OTHER so it will compete for resources with all other tasks in the system, potenti

Re: [PATCH v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-30 Thread Sebastian Andrzej Siewior
On 2024-10-29 22:47:21 [+0100], Frederic Weisbecker wrote: > Le Tue, Oct 29, 2024 at 02:52:31PM +0100, Sebastian Andrzej Siewior a écrit : > > On 2024-10-28 15:01:55 [+0100], Frederic Weisbecker wrote: > > > > diff --git a/include/linux/interrupt.h b/include/linux/inte

Re: [PATCH v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-29 Thread Sebastian Andrzej Siewior
On 2024-10-28 15:01:55 [+0100], Frederic Weisbecker wrote: > > diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h > > index 457151f9f263d..9637af78087f3 100644 > > --- a/include/linux/interrupt.h > > +++ b/include/linux/interrupt.h > > @@ -616,6 +616,50 @@ extern void __raise_softir

[PATCH v2 0/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-25 Thread Sebastian Andrzej Siewior
Hi, the following was in the PREEMPT_RT queue since last softirq rework. The result is that timer wake ups (hrtimer, timer_list) happens in hardirq processing them requires to wake ksoftirqd. ksoftirqd runs at SCHED_OTHER so it will compete for resources with all other tasks in the system, potenti

[PATCH v2 2/3] timers: Use __raise_softirq_irqoff() to raise the softirq.

2024-10-25 Thread Sebastian Andrzej Siewior
softirq. Signed-off-by: Sebastian Andrzej Siewior --- kernel/time/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 0fc9d066a7be4..1759de934284c 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2499,7 +2499,7

Re: stable-rc linux-6.6.y: Queues: tinyconfig: undefined reference to `irq_work_queue'

2024-10-24 Thread Sebastian Andrzej Siewior
On 2024-10-24 22:56:53 [+0530], Naresh Kamboju wrote: > On Thu, 24 Oct 2024 at 20:11, Naresh Kamboju > wrote: > > > > Most of the tinyconfigs are failing on stable-rc linux-6.6.y. > > > > Build errors: > > -- > > aarch64-linux-gnu-ld: kernel/task_work.o: in function `task_work_add': >

[PATCH v2 3/3] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-24 Thread Sebastian Andrzej Siewior
x by introduction of local_timers_pending() for tick_nohz_next_event() ] [ junxiao.ch...@intel.com: Ensure ktimersd gets woken up even if a softirq is currently served. ] Reviewed-by: Paul E. McKenney [rcutorture] Signed-off-by: Sebastian Andrzej Siewior --- include/li

[PATCH v2 1/3] hrtimer: Use __raise_softirq_irqoff() to raise the softirq.

2024-10-24 Thread Sebastian Andrzej Siewior
Andrzej Siewior --- kernel/time/hrtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index cddcd08ea827f..5402e0f242178 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1811,7 +1811,7 @@ void

Re: [PATCH 1/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-23 Thread Sebastian Andrzej Siewior
On 2024-10-23 08:30:18 [+0200], To Frederic Weisbecker wrote: > > > > > +void raise_timer_softirq(void) > > > > > +{ > > > > > + unsigned long flags; > > > > > + > > > > > + local_irq_save(flags); > > > > > + raise_ktimers_thread(TIMER_SOFTIRQ); > > > > > + wake_timersd(); > > > >

Re: [PATCH 1/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-22 Thread Sebastian Andrzej Siewior
On 2024-10-23 00:27:34 [+0200], Frederic Weisbecker wrote: > > Try again without the "ksoftirqd will collect it all" since this won't > > happen since the revert I mentioned. > > I still don't get it, this makes: > > """ > Once the ksoftirqd is marked as pending (or is running), a softirq which >

Re: [PATCH 1/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-22 Thread Sebastian Andrzej Siewior
On 2024-10-22 15:28:56 [+0200], Frederic Weisbecker wrote: > Le Fri, Oct 04, 2024 at 12:17:04PM +0200, Sebastian Andrzej Siewior a écrit : > > A timer/ hrtimer softirq is raised in-IRQ context. With threaded > > interrupts enabled or on PREEMPT_RT this leads to waking the ksofti

Re: [peterz-queue:sched/lazy] [sched, x86] 74d850cd4c: WARNING:at_kernel/rcu/rcutorture.c:#rcu_torture_stats_print[rcutorture]

2024-10-16 Thread Sebastian Andrzej Siewior
On 2024-10-15 15:47:20 [+0800], kernel test robot wrote: > Hello, Hi, it took me a while to reproduce this because it does not trigger without the ltp userland and this is not downloaded properly so I had to workaround it. However… > [ 98.006999][ T543] busted-torture: rtc: 639e821e ve

Re: RE: [RFC PATCH v2 2/4] Documentation: RCU: Refer to ptr_eq()

2024-10-07 Thread Sebastian Andrzej Siewior
On 2024-10-06 19:52:49 [+], David Laight wrote: > From: Mathieu Desnoyers > > Sent: 04 October 2024 19:28 > > > > Refer to ptr_eq() in the rcu_dereference() documentation. > > > > ptr_eq() is a mechanism that preserves address dependencies when > > comparing pointers, and should be favored wh

[PATCH 1/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-04 Thread Sebastian Andrzej Siewior
x by introduction of local_pending_timers() for tick_nohz_next_event() ] [ junxiao.ch...@intel.com: Ensure ktimersd gets woken up even if a softirq is currently served. ] Signed-off-by: Sebastian Andrzej Siewior --- include/linux/interrupt.h | 29 ++ kernel/rcu/rcutorture.c | 6 +

[PATCH 0/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-04 Thread Sebastian Andrzej Siewior
Hi, the following was in the PREEMPT_RT queue since last softirq rework. The result is that timer wake ups (hrtimer, timer_list) happens in hardirq processing them requires to wake ksoftirqd leading two: - ksoftirqd will consume all further softirqs. That means all soft interrupts that would be

Re: [PATCH v5 0/2] Clean up usage of rt_task()

2024-06-05 Thread Sebastian Andrzej Siewior
On 2024-06-04 15:42:26 [+0100], Qais Yousef wrote: > Make rt_task() return true only for RT class and add new realtime_task() to > return true for RT and DL classes to avoid some confusion the old API can > cause. Reviewed-by: Sebastian Andrzej Siewior Sebastian

  1   2   3   4   5   6   7   8   9   10   >