From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Peter Zijlstra <peterz@infradead.org>
Cc: juri.lelli@redhat.com, vincent.guittot@linaro.org,
dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de,
vschneid@redhat.com, clrkwllms@kernel.org,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev,
Linus Torvalds <torvalds@linux-foundation.org>,
mingo@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
sathvika@linux.ibm.com
Subject: Re: [PATCH] sched: Further restrict the preemption modes
Date: Mon, 9 Mar 2026 14:43:01 +0530 [thread overview]
Message-ID: <05990951-e8f5-4834-9ec0-d54af995ae01@linux.ibm.com> (raw)
In-Reply-To: <b0e30f81-b06c-451b-abdc-ede71fa4a96b@linux.ibm.com>
On 2/27/26 8:58 PM, Shrikanth Hegde wrote:
> Hi Steve.
>
> On 2/27/26 8:23 PM, Steven Rostedt wrote:
>> On Fri, 27 Feb 2026 14:39:42 +0530
>> Shrikanth Hegde <sshegde@linux.ibm.com> wrote:
>>
>>> I am afraid we will have trace all functions to begin with (which is
>>> expensive), but filter
>>> out those which took minimal time (like less than a 1s or so). that
>>> would eventually leave only a
>>> few functions that actually took more than 1s(that should have
>>> limited overhead).
>>
It is possible to remove tracing for some function after they were enabled
in kernel? or this could only be done from user by looking at trace buffer?
Even if it doable, This would allow us to trace functions that took a lot of time.
But we should be aiming to calculate the kernel paths that took a lot of time?
>> Well, I think the detection can be done with timings between schedules.
>> What's the longest running task without any voluntary schedule. Then you
>> can add function graph tracing to it where it can possibly trigger in the
>> location that detected the issue.
>>
This would not work either. We will have sched in/sched out even when
running in userspace.
Lets say, user makes a syscall, the process will continue to in R state,
we only need to track the long running time in kernel, but not in userspace.
>> On a detection of a long schedule, a stack trace can be recorded. Using
>> that stack trace, you could use the function graph tracer to see what is
>> happening.
>>
>> Anyway, something to think about, and this could be a topic at this years
>> Linux Plumbers Tracing MC ;-)
>>
>
We could track the kernel paths, i.e different entry/exit points into kernel.
1. syscall entry/exit.
2. irq entry/exit.
3. kworker threads.
For 1 and 2 we have tracepoints already. For 3, we can use sched in/sched out tracepoints
to see if and when it takes a long time.
All of them could be combined in one bpf program. Any thoughts?
Getting stacktrace of 3 is doable i guess, i.e when sched_out happen while in R state and time
check has failed. But for 1,2 getting a stack is going to be difficult.
Please add if i have missed more kernel paths where we want detection to happen.
next prev parent reply other threads:[~2026-03-09 9:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 10:15 [PATCH] sched: Further restrict the preemption modes Peter Zijlstra
2026-01-06 15:23 ` Valentin Schneider
2026-01-06 16:40 ` Steven Rostedt
2026-01-09 11:23 ` Shrikanth Hegde
2026-02-25 10:53 ` Peter Zijlstra
2026-02-25 12:56 ` Shrikanth Hegde
2026-02-26 0:48 ` Steven Rostedt
2026-02-26 5:30 ` Shrikanth Hegde
2026-02-26 17:22 ` Steven Rostedt
2026-02-27 9:09 ` Shrikanth Hegde
2026-02-27 14:53 ` Steven Rostedt
2026-02-27 15:28 ` Shrikanth Hegde
2026-03-09 9:13 ` Shrikanth Hegde [this message]
2026-02-24 15:45 ` Ciunas Bennett
2026-02-24 17:11 ` Sebastian Andrzej Siewior
2026-02-25 9:56 ` Ciunas Bennett
2026-02-25 2:30 ` Ilya Leoshkevich
2026-02-25 16:33 ` Christian Borntraeger
2026-02-25 18:30 ` Douglas Freimuth
2026-03-03 9:15 ` Ciunas Bennett
2026-03-03 11:52 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=05990951-e8f5-4834-9ec0-d54af995ae01@linux.ibm.com \
--to=sshegde@linux.ibm.com \
--cc=bigeasy@linutronix.de \
--cc=bsegall@google.com \
--cc=clrkwllms@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=maddy@linux.ibm.com \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sathvika@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox