Re: [PATCH] rethook: Use tsk->on_cpu to check task execution state

From: Google

Date: Fri Jun 05 2026 - 09:45:45 EST


On Thu, 4 Jun 2026 11:34:45 +0200
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> On Mon, Jun 01, 2026 at 08:40:01AM +0900, Masami Hiramatsu wrote:
>
> > Peter, is it OK to drop @rq from task_on_cpu()?
>
> Sure.
>
> > Then we can use it from rethook.
>
> Well, it is in sched/sched.h, which is an internal header, and no you
> cannot use that header in rethook.

Ah, OK. Hmm, then we should not use it. Maybe ->on_cpu is also internal
state?

>
> But lets step back first, what is the actual problem here, why are we
> looking at ->on_cpu at all?

Tengda, can you explain it?
I think you want to take a stacktrace on !current process, and
rethook_find_ret_addr() is rejected i the task is running state.

But if you can share actual situation what you need, it is
helpful for us to understand.

Thank you,


--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>