Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Joel Fernandes
On Tue, Feb 4, 2025 at 10:03 PM Steven Rostedt wrote: > > On Tue, 4 Feb 2025 19:56:09 -0500 > Joel Fernandes wrote: > > > > Here is the RFC I had sent that Peter is referring > > > > FWIW, I second the idea of a new syscall for this than (ab)using rseq > > and also independence from preemption me

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Steven Rostedt
On Tue, 4 Feb 2025 19:56:09 -0500 Joel Fernandes wrote: > > Here is the RFC I had sent that Peter is referring > > FWIW, I second the idea of a new syscall for this than (ab)using rseq > and also independence from preemption method. I agree that something > generic is better than relying on pr

Re: [PATCH v4 28/39] unwind_user/deferred: Add deferred unwinding interface

2025-02-04 Thread Josh Poimboeuf
On Thu, Jan 30, 2025 at 03:21:36PM -0500, Steven Rostedt wrote: > Coming back from this. It would be fine if we could do the back trace when > we come back from the scheduler, so it should not be an issue if the task > even has to schedule again to fault in the sframe information. So there would b

Re: [PATCH v4 17/39] unwind_user/sframe: Add support for reading .sframe headers

2025-02-04 Thread Josh Poimboeuf
On Thu, Jan 30, 2025 at 01:39:52PM -0800, Indu Bhagat wrote: > On 1/28/25 6:02 PM, Josh Poimboeuf wrote: > > However, if we're going that route, we might want to even consider a > > completely revamped data layout. For example: > > > > One insight is that the vast majority of (cfa, fp, ra) tuples

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Joel Fernandes
> On Feb 4, 2025, at 5:44 PM, Prakash Sangappa > wrote: > >  > >> On Feb 1, 2025, at 10:11 AM, Peter Zijlstra wrote: >> >>> On Sat, Feb 01, 2025 at 07:47:32AM -0500, Steven Rostedt wrote: >>> >>> >>> On February 1, 2025 6:59:06 AM EST, Peter Zijlstra >>> wrote: >>> I still have

Re: [PATCH] ftrace: Avoid potential division by zero in function_stat_show()

2025-02-04 Thread Steven Rostedt
On Tue, 4 Feb 2025 17:20:45 -0500 Steven Rostedt wrote: > x = rec->counter > > x * (x - 1) * 1000 = (2^32 - 1) // use minus 1 just to be sure > x * (x - 1) = (2^32 - 1) / 1000 > x^2 - x = (2^32 - 1) / 1000 > x^2 - x - (2^32 - 1) / 1000 = 0 > > x = (-b +/- sqrt(b^2 - 4ac)) / 2a > > a

Re: [PATCH v2 16/16] scripts/sorttable: ftrace: Do not add weak functions to available_filter_functions

2025-02-04 Thread Steven Rostedt
On Wed, 5 Feb 2025 00:13:26 + Martin Kelly wrote: > I'm not necessarily a qualified reviewer for this patch, but I'm very > interested in seeing it or a similar solution get merged, as the impact > when it hits is significant (silent failure) and not easy to detect or > work around. Is there

Re: [PATCH v2 16/16] scripts/sorttable: ftrace: Do not add weak functions to available_filter_functions

2025-02-04 Thread Martin Kelly
On Thu, 2025-01-02 at 18:26 -0500, Steven Rostedt wrote: > From: Steven Rostedt > > When a function is annotated as "weak" and is overridden, the code is > not > removed. If it is traced, the fentry/mcount location in the weak > function > will be referenced by the "__mcount_loc" section. This wi

Re: [PATCH 0/2] tools: Unify top-level quiet infrastructure

2025-02-04 Thread Charlie Jenkins
On Tue, Feb 04, 2025 at 11:02:42PM +, Alexei Starovoitov wrote: > On Tue, Feb 4, 2025 at 7:04 PM Namhyung Kim wrote: > > > > Hello, > > > > On Tue, Feb 04, 2025 at 10:34:41AM -0800, Charlie Jenkins wrote: > > > On Tue, Feb 04, 2025 at 05:18:42PM +, Alexei Starovoitov wrote: > > > > On Tue,

Re: [PATCH 0/2] tools: Unify top-level quiet infrastructure

2025-02-04 Thread Alexei Starovoitov
On Tue, Feb 4, 2025 at 7:04 PM Namhyung Kim wrote: > > Hello, > > On Tue, Feb 04, 2025 at 10:34:41AM -0800, Charlie Jenkins wrote: > > On Tue, Feb 04, 2025 at 05:18:42PM +, Alexei Starovoitov wrote: > > > On Tue, Feb 4, 2025 at 12:10 AM Charlie Jenkins > > > wrote: > > > > > > > > The quiet

Re: [PATCH] ftrace: Avoid potential division by zero in function_stat_show()

2025-02-04 Thread Steven Rostedt
On Tue, 4 Feb 2025 10:43:02 +0300 Nikolay Kuratov wrote: > Thank you for the review! > > `counter > rec->counter` check does not protect us from overflows, > so this could mislead especially with the comment included. Ah you're right, as there's a big multiplication there. > > I think we sho

Re: [PATCH rcu v2] 4/5] rcu-tasks: Move RCU Tasks self-tests to core_initcall()

2025-02-04 Thread Paul E. McKenney
On Tue, Feb 04, 2025 at 05:34:09PM +0100, Sebastian Andrzej Siewior wrote: > On 2025-02-04 03:51:48 [-0800], Paul E. McKenney wrote: > > On Tue, Feb 04, 2025 at 11:26:11AM +0100, Sebastian Andrzej Siewior wrote: > > > On 2025-01-30 10:53:19 [-0800], Paul E. McKenney wrote: > > > > The timer and hrt

Re: [PATCH v4 17/39] unwind_user/sframe: Add support for reading .sframe headers

2025-02-04 Thread Josh Poimboeuf
On Thu, Jan 30, 2025 at 01:21:21PM -0800, Indu Bhagat wrote: > > Yeah, and it's actually bothering me quite a lot 🙂 I have a tentative > > proposal, maybe we can discuss this for SFrame v3? Let me briefly > > outline the idea. > > > > I looked at the idea below. It could work wrt unaligned acces

Re: [PATCH v4 26/39] unwind_user/sframe: Enable debugging in uaccess regions

2025-02-04 Thread Josh Poimboeuf
On Thu, Jan 30, 2025 at 05:38:24PM +0100, Jens Remus wrote: > Add a similar debug message for SFRame FDE user copy failures? > > diff --git a/kernel/unwind/sframe.c b/kernel/unwind/sframe.c > > @@ -125,6 +125,7 @@ static __always_inline int __find_fde(struct > sframe_section *sec, > retu

Re: [PATCH v4 19/39] unwind_user/sframe: Add support for reading .sframe contents

2025-02-04 Thread Josh Poimboeuf
On Thu, Jan 30, 2025 at 07:51:15PM +, Weinan Liu wrote: > Nit: swap() might be a simplify way to alternate pointers between two > fre_addr[] entries. > > For example, > > static __always_inline int __find_fre(struct sframe_section *sec, > struct sframe_fde

Re: [PATCH v4 25/39] unwind_user/sframe: Show file name in debug output

2025-02-04 Thread Josh Poimboeuf
On Thu, Jan 30, 2025 at 05:17:33PM +0100, Jens Remus wrote: > On 22.01.2025 03:31, Josh Poimboeuf wrote: > > When debugging sframe issues, the error messages aren't all that helpful > > without knowing what file a corresponding .sframe section belongs to. > > Prefix debug output strings with the fi

Re: [PATCH 0/2] tools: Unify top-level quiet infrastructure

2025-02-04 Thread Namhyung Kim
Hello, On Tue, Feb 04, 2025 at 10:34:41AM -0800, Charlie Jenkins wrote: > On Tue, Feb 04, 2025 at 05:18:42PM +, Alexei Starovoitov wrote: > > On Tue, Feb 4, 2025 at 12:10 AM Charlie Jenkins > > wrote: > > > > > > The quiet infrastructure was moved out of Makefile.build to accomidate > > > th

Re: [PATCH v4 19/39] unwind_user/sframe: Add support for reading .sframe contents

2025-02-04 Thread Josh Poimboeuf
On Thu, Jan 30, 2025 at 04:47:00PM +0100, Jens Remus wrote: > On 22.01.2025 03:31, Josh Poimboeuf wrote: > > +struct sframe_fre { > > + unsigned intsize; > > + s32 ip_off; > > The IP offset (from function start) in the SFrame V2 FDE is unsigned: > > u32 ip_off; Indeed. > > +

Re: [PATCH v4 19/39] unwind_user/sframe: Add support for reading .sframe contents

2025-02-04 Thread Josh Poimboeuf
On Thu, Jan 30, 2025 at 07:07:32AM -0800, Indu Bhagat wrote: > On 1/21/25 6:31 PM, Josh Poimboeuf wrote: > > + for (i = 0; i < fde->fres_num; i++) { > > + int ret; > > + > > + /* > > +* Alternate between the two fre_addr[] entries for 'fre' and > > +* '

Re: [PATCH 0/2] tools: Unify top-level quiet infrastructure

2025-02-04 Thread Charlie Jenkins
On Tue, Feb 04, 2025 at 05:18:42PM +, Alexei Starovoitov wrote: > On Tue, Feb 4, 2025 at 12:10 AM Charlie Jenkins wrote: > > > > The quiet infrastructure was moved out of Makefile.build to accomidate > > the new syscall table generation scripts in perf. Syscall table > > generation wanted to a

Re: [PATCH v4 17/39] unwind_user/sframe: Add support for reading .sframe headers

2025-02-04 Thread Josh Poimboeuf
On Wed, Jan 29, 2025 at 04:02:34PM -0800, Andrii Nakryiko wrote: > On Tue, Jan 28, 2025 at 6:02 PM Josh Poimboeuf wrote: > I'm not sure about this chunked lookup approach for arbitrary user > space applications. Those executable sections can be a) big and b) > discontiguous. E.g., one of the produ

Re: [PATCH 0/2] tools: Unify top-level quiet infrastructure

2025-02-04 Thread Alexei Starovoitov
On Tue, Feb 4, 2025 at 12:10 AM Charlie Jenkins wrote: > > The quiet infrastructure was moved out of Makefile.build to accomidate > the new syscall table generation scripts in perf. Syscall table > generation wanted to also be able to be quiet, so instead of again > copying the code to set the qui

Re: [PATCH] docs: Move "debugging" section to the top in index.rst

2025-02-04 Thread Jonathan Corbet
Purva Yeshi writes: > Move the "debugging" entry to the top in Documentation/trace/index.rst. > Turn index.rst into a good starting point for people wanting to learn > about tracing. Make it the first document users see, as it serves as a > tracing tutorial > > Signed-off-by: Purva Yeshi > ---

Re: [PATCH rcu v2] 4/5] rcu-tasks: Move RCU Tasks self-tests to core_initcall()

2025-02-04 Thread Sebastian Andrzej Siewior
On 2025-02-04 03:51:48 [-0800], Paul E. McKenney wrote: > On Tue, Feb 04, 2025 at 11:26:11AM +0100, Sebastian Andrzej Siewior wrote: > > On 2025-01-30 10:53:19 [-0800], Paul E. McKenney wrote: > > > The timer and hrtimer softirq processing has moved to dedicated threads > > > for kernels built with

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Steven Rostedt
On Tue, 4 Feb 2025 16:30:53 +0100 Peter Zijlstra wrote: > If you go back and reread that initial thread, you'll find the 50us is > below the scheduling latency that random test box already had. > > I'm sure more modern systems will have a lower number, and slower > systems will have a larger num

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Peter Zijlstra
On Tue, Feb 04, 2025 at 07:51:00AM -0500, Steven Rostedt wrote: > On Tue, 4 Feb 2025 10:16:13 +0100 > Peter Zijlstra wrote: > > > And yes, you can still use the whole 'delay preemption' hint for RT > > tasks just fine. Spinlocks isn't the only thing. It can be used to make > > any RSEQ section mo

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Steven Rostedt
n Tue, 4 Feb 2025 08:16:53 -0500 Steven Rostedt wrote: > On Tue, 4 Feb 2025 07:51:00 -0500 > Steven Rostedt wrote: > > > > I'm so confused, WTF do you then need the lazy crap? > > IOW, the "lazy crap" was created to solve this very issue. The holding of > sleeping spin locks interrupted by a

[PATCH] docs: Move "debugging" section to the top in index.rst

2025-02-04 Thread Purva Yeshi
Move the "debugging" entry to the top in Documentation/trace/index.rst. Turn index.rst into a good starting point for people wanting to learn about tracing. Make it the first document users see, as it serves as a tracing tutorial Signed-off-by: Purva Yeshi --- Documentation/trace/index.rst | 2

Re: [PATCH v2] trace/osnoise: Add trace events for samples

2025-02-04 Thread Tomas Glozar
po 3. 2. 2025 v 10:04 odesílatel Tomas Glozar napsal: > A proof-of-concept bpftrace script using this feature: > https://gitlab.com/-/snippets/4801190 > I added another PoC using event histograms to the snippet. That one captures data from all CPUs, and thus can be used for testing on machines wi

[PATCH v2] kmem/tracing: Add kmem name to kmem_cache_alloc tracepoint

2025-02-04 Thread Wander Lairson Costa
The kmem_cache_free tracepoint includes a "name" field, which allows for easy identification and filtering of specific kmem's. However, the kmem_cache_alloc tracepoint lacks this field, making it difficult to pair corresponding alloc and free events for analysis. Add the "name" field to kmem_cache

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Steven Rostedt
On Tue, 4 Feb 2025 07:51:00 -0500 Steven Rostedt wrote: > > I'm so confused, WTF do you then need the lazy crap? IOW, the "lazy crap" was created to solve this very issue. The holding of sleeping spin locks interrupted by a scheduler tick. I'm just giving user space the same feature that we gave

Re: [PATCH] arm64: Kconfig: Remove selecting replaced HAVE_FUNCTION_GRAPH_RETVAL

2025-02-04 Thread Will Deacon
On Fri, 17 Jan 2025 07:55:22 -0500, Lukas Bulwahn wrote: > Commit a3ed4157b7d8 ("fgraph: Replace fgraph_ret_regs with ftrace_regs") > replaces the config HAVE_FUNCTION_GRAPH_RETVAL with the config > HAVE_FUNCTION_GRAPH_FREGS, and it replaces all the select commands in the > various architecture Kco

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Steven Rostedt
On Tue, 4 Feb 2025 10:16:13 +0100 Peter Zijlstra wrote: > And yes, you can still use the whole 'delay preemption' hint for RT > tasks just fine. Spinlocks isn't the only thing. It can be used to make > any RSEQ section more likely to succeed. > > > > Patch 2 changes that to do what you wrote th

Re: [PATCH] arm64: Kconfig: Remove selecting replaced HAVE_FUNCTION_GRAPH_RETVAL

2025-02-04 Thread Will Deacon
On Tue, Feb 04, 2025 at 12:44:25PM +0100, Lukas Bulwahn wrote: > On Tue, Feb 4, 2025 at 12:36 PM Will Deacon wrote: > > > > On Fri, Jan 17, 2025 at 07:55:22AM -0500, Lukas Bulwahn wrote: > > > From: Lukas Bulwahn > > > > > > Commit a3ed4157b7d8 ("fgraph: Replace fgraph_ret_regs with ftrace_regs")

Re: [PATCH rcu v2] 4/5] rcu-tasks: Move RCU Tasks self-tests to core_initcall()

2025-02-04 Thread Paul E. McKenney
On Tue, Feb 04, 2025 at 11:26:11AM +0100, Sebastian Andrzej Siewior wrote: > On 2025-01-30 10:53:19 [-0800], Paul E. McKenney wrote: > > The timer and hrtimer softirq processing has moved to dedicated threads > > for kernels built with CONFIG_IRQ_FORCED_THREADING=y. This results in > > timers not

Re: [PATCH] arm64: Kconfig: Remove selecting replaced HAVE_FUNCTION_GRAPH_RETVAL

2025-02-04 Thread Lukas Bulwahn
On Tue, Feb 4, 2025 at 12:36 PM Will Deacon wrote: > > On Fri, Jan 17, 2025 at 07:55:22AM -0500, Lukas Bulwahn wrote: > > From: Lukas Bulwahn > > > > Commit a3ed4157b7d8 ("fgraph: Replace fgraph_ret_regs with ftrace_regs") > > replaces the config HAVE_FUNCTION_GRAPH_RETVAL with the config > > HAV

Re: [PATCH] arm64: Kconfig: Remove selecting replaced HAVE_FUNCTION_GRAPH_RETVAL

2025-02-04 Thread Will Deacon
On Fri, Jan 17, 2025 at 07:55:22AM -0500, Lukas Bulwahn wrote: > From: Lukas Bulwahn > > Commit a3ed4157b7d8 ("fgraph: Replace fgraph_ret_regs with ftrace_regs") > replaces the config HAVE_FUNCTION_GRAPH_RETVAL with the config > HAVE_FUNCTION_GRAPH_FREGS, and it replaces all the select commands i

Re: [PATCH rcu v2] 4/5] rcu-tasks: Move RCU Tasks self-tests to core_initcall()

2025-02-04 Thread Sebastian Andrzej Siewior
On 2025-01-30 10:53:19 [-0800], Paul E. McKenney wrote: > The timer and hrtimer softirq processing has moved to dedicated threads > for kernels built with CONFIG_IRQ_FORCED_THREADING=y. This results in > timers not expiring until later in early boot, which in turn causes the > RCU Tasks self-tests

Re: [PATCH v22 19/20] ftrace: Add ftrace_get_symaddr to convert fentry_ip to symaddr

2025-02-04 Thread Google
On Mon, 3 Feb 2025 22:33:48 +0100 Gabriel de Perthuis wrote: > Hello, > > I got errors building Linux 6.14-rc1 that were solved by reverting this > patch and the one after (19/20 and 20/20). > > Errors look like: > > In file included from ./arch/x86/include/asm/asm-prototypes.h:2, >

Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice

2025-02-04 Thread Peter Zijlstra
On Mon, Feb 03, 2025 at 11:45:37AM -0500, Steven Rostedt wrote: > > Lazy only applies to fair (and whatever bpf things end up using > > resched_curr_lazy()). > > Is that a problem? User spin locks for RT tasks are very dangerous. If an > RT task preempts the owner that is of lower priority, it ca