Re: [RFC PATCH v3 13/15] context_tracking,x86: Add infrastructure to defer kernel TLBI

2024-12-10 Thread Valentin Schneider
On 09/12/24 15:42, Petr Tesarik wrote: > On Mon, 9 Dec 2024 13:12:49 +0100 > Peter Zijlstra wrote: > >> On Mon, Dec 09, 2024 at 01:04:43PM +0100, Valentin Schneider wrote: >> >> > > But I wonder what exactly was the original scenario encountered by >

Re: [RFC PATCH v3 13/15] context_tracking,x86: Add infrastructure to defer kernel TLBI

2024-12-09 Thread Valentin Schneider
On 05/12/24 18:31, Petr Tesarik wrote: > On Thu, 21 Nov 2024 16:30:16 +0100 > Peter Zijlstra wrote: > >> On Thu, Nov 21, 2024 at 07:07:44AM -0800, Dave Hansen wrote: >> > On 11/21/24 03:12, Peter Zijlstra wrote: >> > >> I see e.g. ds_clear_cea() clears PTEs that can have the _PAGE_GLOBAL >> > >>

Re: [RFC PATCH v3 11/15] context-tracking: Introduce work deferral infrastructure

2024-11-29 Thread Valentin Schneider
On 24/11/24 22:46, Frederic Weisbecker wrote: > Le Fri, Nov 22, 2024 at 03:56:59PM +0100, Valentin Schneider a écrit : >> On 20/11/24 18:30, Frederic Weisbecker wrote: >> > Le Wed, Nov 20, 2024 at 06:10:43PM +0100, Valentin Schneider a écrit : >> >> On 20/11/24 15

Re: [RFC PATCH v3 11/15] context-tracking: Introduce work deferral infrastructure

2024-11-22 Thread Valentin Schneider
On 20/11/24 18:30, Frederic Weisbecker wrote: > Le Wed, Nov 20, 2024 at 06:10:43PM +0100, Valentin Schneider a écrit : >> On 20/11/24 15:23, Frederic Weisbecker wrote: >> >> > Ah but there is CT_STATE_GUEST and I see the last patch also applies that >> > to >

Re: [RFC PATCH v3 04/15] rcu: Add a small-width RCU watching counter debug option

2024-11-22 Thread Valentin Schneider
On 22/11/24 04:53, Paul E. McKenney wrote: > On Tue, Nov 19, 2024 at 04:34:51PM +0100, Valentin Schneider wrote: >> +config RCU_DYNTICKS_TORTURE >> +bool "Minimize RCU dynticks counter size" >> +depends on RCU_EXPERT >> +default n >> +he

Re: [RFC PATCH v3 06/15] jump_label: Add forceful jump label type

2024-11-22 Thread Valentin Schneider
On 21/11/24 12:21, Josh Poimboeuf wrote: > On Thu, Nov 21, 2024 at 04:51:09PM +0100, Valentin Schneider wrote: >> Okay so forcing the IPI for .noinstr patching lets us get rid of all the >> force_ipi faff; however I would still want the special marking to tell >> objtool &quo

Re: [RFC PATCH v3 06/15] jump_label: Add forceful jump label type

2024-11-21 Thread Valentin Schneider
On 21/11/24 12:00, Peter Zijlstra wrote: > On Wed, Nov 20, 2024 at 08:55:15AM -0800, Josh Poimboeuf wrote: >> On Wed, Nov 20, 2024 at 03:57:46PM +0100, Peter Zijlstra wrote: >> > On Wed, Nov 20, 2024 at 03:56:49PM +0100, Peter Zijlstra wrote: >> > >> > > But I think we can make the fall-back safer,

Re: [RFC PATCH v3 13/15] context_tracking,x86: Add infrastructure to defer kernel TLBI

2024-11-20 Thread Valentin Schneider
On 20/11/24 16:32, Peter Zijlstra wrote: > On Wed, Nov 20, 2024 at 04:22:16PM +0100, Peter Zijlstra wrote: >> On Tue, Nov 19, 2024 at 04:35:00PM +0100, Valentin Schneider wrote: >> >> > +void noinstr __flush_tlb_all_noinstr(void) >> > +{ >> > + /* >&g

Re: [RFC PATCH v3 11/15] context-tracking: Introduce work deferral infrastructure

2024-11-20 Thread Valentin Schneider
On 20/11/24 15:23, Frederic Weisbecker wrote: > Ah but there is CT_STATE_GUEST and I see the last patch also applies that to > CT_STATE_IDLE. > > So that could be: > > bool ct_set_cpu_work(unsigned int cpu, unsigned int work) > { > struct context_tracking *ct = per_cpu_ptr(&context_tracking,

Re: [RFC PATCH v3 08/15] sched/clock, x86: Make __sched_clock_stable forceful

2024-11-20 Thread Valentin Schneider
On 20/11/24 15:59, Peter Zijlstra wrote: > On Tue, Nov 19, 2024 at 04:34:55PM +0100, Valentin Schneider wrote: >> Later commits will cause objtool to warn about non __ro_after_init static >> keys being used in .noinstr sections in order to safely defer instruction >> patc

Re: [RFC PATCH v3 06/15] jump_label: Add forceful jump label type

2024-11-20 Thread Valentin Schneider
On 19/11/24 15:39, Josh Poimboeuf wrote: > On Tue, Nov 19, 2024 at 04:34:53PM +0100, Valentin Schneider wrote: >> Later commits will cause objtool to warn about non __ro_after_init static >> keys being used in .noinstr sections in order to safely defer instruction >> patc

Re: [RFC PATCH v3 04/15] rcu: Add a small-width RCU watching counter debug option

2024-11-20 Thread Valentin Schneider
On 20/11/24 15:50, Peter Zijlstra wrote: > On Tue, Nov 19, 2024 at 04:34:51PM +0100, Valentin Schneider wrote: >> A later commit will reduce the size of the RCU watching counter to free up >> some bits for another purpose. Paul suggested adding a config option to >> test the e

Re: [RFC PATCH v3 00/15] context_tracking,x86: Defer some IPIs until a user->kernel transition

2024-11-19 Thread Valentin Schneider
On 19/11/24 11:45, Steven Rostedt wrote: > On Tue, 19 Nov 2024 16:34:47 +0100 > Valentin Schneider wrote: > >> Context >> === >> >> We've observed within Red Hat that isolated, NOHZ_FULL CPUs running a >> pure-userspace application get regularly i

[RFC PATCH v3 08/15] sched/clock, x86: Make __sched_clock_stable forceful

2024-11-19 Thread Valentin Schneider
). Suppressing the text_poke_sync() IPI has little benefits for this key, as NOHZ_FULL is incompatible with an unstable TSC anyway. Mark it as forceful to let the kernel know to always send the text_poke_sync() IPI for it, and to let objtool know not to warn about it. Signed-off-by: Valentin Schneider

[RFC PATCH v3 06/15] jump_label: Add forceful jump label type

2024-11-19 Thread Valentin Schneider
NOHZ_FULL interference, so add a jump type that will be leveraged by both the kernel (to know not to defer the IPI) and objtool (to know not to generate the aforementioned warning). Signed-off-by: Valentin Schneider --- include/linux/jump_label.h | 26 +++--- 1 file changed, 19

[RFC PATCH v3 15/15] context-tracking: Add a Kconfig to enable IPI deferral for NO_HZ_IDLE

2024-11-19 Thread Valentin Schneider
/performance), but the backing mechanism is identical. Add a default-no option to enable IPI deferral with NO_HZ_IDLE. Signed-off-by: Valentin Schneider --- kernel/time/Kconfig | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/kernel/time/Kconfig b/kernel/time

[RFC PATCH v3 14/15] x86/mm, mm/vmalloc: Defer flush_tlb_kernel_range() targeting NOHZ_FULL CPUs

2024-11-19 Thread Valentin Schneider
including user mappings), this only happens when reaching a invalidation range threshold where it is cheaper to do a full flush than to individually invalidate each page in the range via INVLPG. IOW, it doesn't *require* invalidating user mappings, and thus remains safe to defer until a later

[RFC PATCH v3 13/15] context_tracking,x86: Add infrastructure to defer kernel TLBI

2024-11-19 Thread Valentin Schneider
d these be instead new operations made available through pv_ops.mmu.*? x86_64_start_kernel() uses __native_tlb_flush_global() regardless of paravirt, so I'm thinking the paravirt variants are more optimizations than hard requirements? Signed-off-by: Valentin Schneider --

[RFC PATCH v3 12/15] context_tracking,x86: Defer kernel text patching IPIs

2024-11-19 Thread Valentin Schneider
ge the new context_tracking infrastructure to defer sync_core() IPIs to a target CPU's next kernel entry. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Valentin Schneider --- arch/x86/include/asm/context_tracking_work.h | 6 ++-- arch/x86/include/asm/

[RFC PATCH v3 11/15] context-tracking: Introduce work deferral infrastructure

2024-11-19 Thread Valentin Schneider
CT_STATE_KERNEL in the ct_state prevents queuing deferred work. Later commits introduce the bit:callback mappings. Link: https://lore.kernel.org/all/20210929151723.162004...@infradead.org/ Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Valentin Schneider

[RFC PATCH v3 10/15] x86/alternatives: Record text_poke's of JUMP_TYPE_FORCEFUL labels

2024-11-19 Thread Valentin Schneider
uch can be (ab)used to store this information at the start of text_poke_bp_batch(). Signed-off-by: Valentin Schneider --- arch/x86/include/asm/text-patching.h | 12 ++-- arch/x86/kernel/alternative.c| 16 ++-- arch/x86/kernel/jump_label.c | 7 --- 3 fi

[RFC PATCH v3 09/15] objtool: Warn about non __ro_after_init static key usage in .noinstr

2024-11-19 Thread Valentin Schneider
would be the result of a code change that will need looking at. Suggested-by: Josh Poimboeuf Signed-off-by: Valentin Schneider --- offset_of(static_key.type) and JUMP_TYPE_FORCEFUL would need to be shoved into a somewhat standalone header file that could be included by objtool itself. --- tools

[RFC PATCH v3 07/15] x86/speculation/mds: Make mds_idle_clear forceful

2024-11-19 Thread Valentin Schneider
and to let objtool know not to warn about it. Signed-off-by: Valentin Schneider --- arch/x86/kernel/cpu/bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 47a01d4028f60..dcc4d5d6e3b95 100644 --- a/arch/x86/kernel/

[RFC PATCH v3 00/15] context_tracking,x86: Defer some IPIs until a user->kernel transition

2024-11-19 Thread Valentin Schneider
es (Steven) o Fixed __ro_after_init keys used in modules (Peter) o Dropped the extra context_tracking atomic, squashed the new bits in the existing .state field (Peter, Frederic) o Added an RCU_EXPERT config for the RCU dynticks counter size, and added an rcutorture case for a low-size

[RFC PATCH v3 05/15] rcutorture: Make TREE04 use CONFIG_RCU_DYNTICKS_TORTURE

2024-11-19 Thread Valentin Schneider
-laptop Suggested-by: Paul E. McKenney Signed-off-by: Valentin Schneider --- tools/testing/selftests/rcutorture/configs/rcu/TREE04 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE04 b/tools/testing/selftests/rcutorture/configs/rcu/TREE04

[RFC PATCH v3 04/15] rcu: Add a small-width RCU watching counter debug option

2024-11-19 Thread Valentin Schneider
RCU_EXPERT. While at it, add a comment to explain the layout of context_tracking->state. Link: http://lore.kernel.org/r/4c2cb573-168f-4806-b1d9-164e8276e66a@paulmck-laptop Suggested-by: Paul E. McKenney Signed-off-by: Valentin Schneider --- include/linux/context_tracking_state.h |

[RFC PATCH v3 03/15] sched/clock: Make sched_clock_running __ro_after_init

2024-11-19 Thread Valentin Schneider
sched_clock_running is only ever enabled in the __init functions sched_clock_init() and sched_clock_init_late(), and is never disabled. Mark it __ro_after_init. Signed-off-by: Valentin Schneider --- kernel/sched/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel

[RFC PATCH v3 02/15] objtool: Flesh out warning related to pv_ops[] calls

2024-11-19 Thread Valentin Schneider
I had to look into objtool itself to understand what this warning was about; make it more explicit. Signed-off-by: Valentin Schneider --- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 5f1d0f95fc04b

[RFC PATCH v3 01/15] objtool: Make validate_call() recognize indirect calls to pv_ops[]

2024-11-19 Thread Valentin Schneider
: Valentin Schneider --- tools/objtool/check.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 6604f5d038aad..5f1d0f95fc04b 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3448,7 +3448,7

Re: [PATCH] docs/vm: hwpoison.rst: Fix quote formatting

2019-06-18 Thread Valentin Schneider
On 18/06/2019 16:31, Jonathan Corbet wrote: > On Tue, 18 Jun 2019 15:56:05 +0100 > Valentin Schneider wrote: > >> The asterisks prepended to the quoted text currently get translated to >> bullet points, which gets increasingly confusing the smaller your >> screen

[PATCH] docs/vm: hwpoison.rst: Fix quote formatting

2019-06-18 Thread Valentin Schneider
The asterisks prepended to the quoted text currently get translated to bullet points, which gets increasingly confusing the smaller your screen is (when viewing the sphinx output, that is). Convert the whole quote to a literal block. Signed-off-by: Valentin Schneider --- Documentation/vm

Re: [RFC PATCH 3/3] sched/Documentation: Point out use of preempt_schedule_irq()

2019-02-01 Thread Valentin Schneider
On 01/02/2019 08:45, Julien Thierry wrote: [...] >> +Kernel preemption >> += >> +When returning from interrupt context, you should call either of >> +preempt_schedule() or preempt_schedule_irq() if preemption is enabled >> +and need_resched() is true. >> + > > I don't think preempt

[RFC PATCH 3/3] sched/Documentation: Point out use of preempt_schedule_irq()

2019-01-31 Thread Valentin Schneider
Since there are a few archs out there that call preempt_schedule_irq() within a need_resched() loop, point out that it's not needed. Signed-off-by: Valentin Schneider Cc: Jonathan Corbet Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Julien Thierry Cc: linux-doc@vger.kerne

[RFC PATCH 0/3] arm/arm64: entry: Remove need_resched() loop

2019-01-31 Thread Valentin Schneider
kml/cc989920-a13b-d53b-db83-1584a7f53...@arm.com/ Valentin Schneider (3): arm64: entry: Remove unneeded need_resched() loop ARM: entry: Remove unneeded need_resched() loop sched/Documentation: Point out use of preempt_schedule_irq() Documentation/scheduler/sched-arch.txt | 10 +++