2023-08-03 09:22:44

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [RFC PATCH v6 4/5] sched, tracing: add to report task state in symbolic chars

On Thu, Aug 03, 2023 at 04:33:51AM -0400, Ze Gao wrote:
> Internal representations of task state are likely to be changed
> or ordered, and reporting them to userspace without exporting
> them as part of API is basically wrong, which can easily break
> a userspace observability tool as kernel evolves. For example,
> perf suffers from this and still reports wrong states as of this
> writing.
>
> OTOH, some masqueraded states like TASK_REPORT_IDLE and
> TASK_REPORT_MAX are also reported inadvertently, which confuses
> things even more and most userspace tools do not even take them
> into consideration.
>
> So add a new variable in company with the old raw value to
> report task state in symbolic chars, which are self-explaining
> and no further translation is needed. Of course this does not
> break any userspace tool.
>
> Note for PREEMPT_ACTIVE, we introduce 'p' to report it and use
> the old conventions for the rest.
>
> Signed-off-by: Ze Gao <[email protected]>
> Reviewed-by: Masami Hiramatsu (Google) <[email protected]>
> Acked-by: Ian Rogers <[email protected]>

I'm not sure you've actually read any of the things I've written. I hate
this. Not going to happen.


2023-08-03 13:24:02

by Ze Gao

[permalink] [raw]
Subject: Re: [RFC PATCH v6 4/5] sched, tracing: add to report task state in symbolic chars

On Thu, Aug 3, 2023 at 4:59 PM Peter Zijlstra <[email protected]> wrote:
>
> On Thu, Aug 03, 2023 at 04:33:51AM -0400, Ze Gao wrote:
> > Internal representations of task state are likely to be changed
> > or ordered, and reporting them to userspace without exporting
> > them as part of API is basically wrong, which can easily break
> > a userspace observability tool as kernel evolves. For example,
> > perf suffers from this and still reports wrong states as of this
> > writing.
> >
> > OTOH, some masqueraded states like TASK_REPORT_IDLE and
> > TASK_REPORT_MAX are also reported inadvertently, which confuses
> > things even more and most userspace tools do not even take them
> > into consideration.
> >
> > So add a new variable in company with the old raw value to
> > report task state in symbolic chars, which are self-explaining
> > and no further translation is needed. Of course this does not
> > break any userspace tool.
> >
> > Note for PREEMPT_ACTIVE, we introduce 'p' to report it and use
> > the old conventions for the rest.
> >
> > Signed-off-by: Ze Gao <[email protected]>
> > Reviewed-by: Masami Hiramatsu (Google) <[email protected]>
> > Acked-by: Ian Rogers <[email protected]>
>
> I'm not sure you've actually read any of the things I've written. I hate
> this. Not going to happen.

With all due respect, I'm afraid I've read so much carefully every word
you replied, I am just not fully convinced and still believe this is something
needs a fix but apparently you strongly refuse.

So I'm considering giving up this patch and only fixing the surface problem
to make everyone happy.

Thanks for taking your time on this topic.

Regards,
Ze