Re: [PATCH 29/30] Documentation: tracing: add TIF_NEED_RESCHED_LAZY

From: Ankur Arora
Date: Wed Feb 21 2024 - 18:23:49 EST



Steven Rostedt <rostedt@xxxxxxxxxxx> writes:

> On Mon, 12 Feb 2024 21:55:53 -0800
> Ankur Arora <ankur.a.arora@xxxxxxxxxx> wrote:
>
>> Document various combinations of resched flags.
>>
>> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
>> Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
>> Cc: Jonathan Corbet <corbet@xxxxxxx>
>> Originally-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>> Link: https://lore.kernel.org/lkml/87jzshhexi.ffs@tglx/
>> Signed-off-by: Ankur Arora <ankur.a.arora@xxxxxxxxxx>
>> ---
>> Documentation/trace/ftrace.rst | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
>> index 7e7b8ec17934..7f20c0bae009 100644
>> --- a/Documentation/trace/ftrace.rst
>> +++ b/Documentation/trace/ftrace.rst
>> @@ -1036,8 +1036,12 @@ explains which is which.
>> be printed here.
>>
>> need-resched:
>> - - 'N' both TIF_NEED_RESCHED and PREEMPT_NEED_RESCHED is set,
>> + - 'B' all three, TIF_NEED_RESCHED, TIF_NEED_RESCHED_LAZY and PREEMPT_NEED_RESCHED are set,
>> + - 'N' both TIF_NEED_RESCHED and PREEMPT_NEED_RESCHED are set,
>> + - 'L' both TIF_NEED_RESCHED_LAZY and PREEMPT_NEED_RESCHED are set,
>> + - 'b' both TIF_NEED_RESCHED and TIF_NEED_RESCHED_LAZY are set,
>> - 'n' only TIF_NEED_RESCHED is set,
>> + - 'l' only TIF_NEED_RESCHED_LAZY is set,
>> - 'p' only PREEMPT_NEED_RESCHED is set,
>> - '.' otherwise.
>>
>
> I wonder if we should also add this information in /sys/kernel/tracing/README
> so that it is easier to find on a machine.

Yeah, there is a problem with the discovery. Seems a little out of place
in tracing/README though.

How about something like this? Though this isn't really a model of clarity.

--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4292,7 +4292,7 @@ static void print_lat_help_header(struct seq_file *m)
{
seq_puts(m, "# _------=> CPU# \n"
"# / _-----=> irqs-off/BH-disabled\n"
- "# | / _----=> need-resched \n"
+ "# | / _----=> need-resched [ l: lazy, n: now, p: preempt, b: l|n, L: l|p, N: n|p, B: l|n|p ]\n"
"# || / _---=> hardirq/softirq \n"
"# ||| / _--=> preempt-depth \n"
"# |||| / _-=> migrate-disable \n"


Also, haven't looked at trace-cmd. Anything I should be sending a patch
out for?

Thanks

--
ankur