Re: [RFC PATCH 00/11] Reviving the Proxy Execution Series

From: Qais Yousef
Date: Wed Oct 19 2022 - 08:11:30 EST


On 10/17/22 02:23, Joel Fernandes wrote:

> I ran a test to check CFS time sharing. The accounting on top is confusing,
> but ftrace confirms the proxying happening.
>
> Task A - pid 122
> Task B - pid 123
> Task C - pid 121
> Task D - pid 124
>
> Here D and B just spin all the time. C is lock owner (in-kernel mutex) and
> spins all the time, while A blocks on the same in-kernel mutex and remains
> blocked.
>
> Then I did "top -H" while the test was running which gives below output.
> The first column is PID, and the third-last column is CPU percentage.
>
> Without PE:
> 121 root 20 0 99496 4 0 R 33.6 0.0 0:02.76 t (task C)
> 123 root 20 0 99496 4 0 R 33.2 0.0 0:02.75 t (task B)
> 124 root 20 0 99496 4 0 R 33.2 0.0 0:02.75 t (task D)
>
> With PE:
> PID
> 122 root 20 0 99496 4 0 D 25.3 0.0 0:22.21 t (task A)
> 121 root 20 0 99496 4 0 R 25.0 0.0 0:22.20 t (task C)
> 123 root 20 0 99496 4 0 R 25.0 0.0 0:22.20 t (task B)
> 124 root 20 0 99496 4 0 R 25.0 0.0 0:22.20 t (task D)
>
> With PE, I was expecting 2 threads with 25% and 1 thread with 50%. Instead I
> get 4 threads with 25% in the top. Ftrace confirms that the D-state task is
> in fact not running and proxying to the owner task so everything seems
> working correctly, but the accounting seems confusing, as in, it is confusing
> to see the D-state task task taking 25% CPU when it is obviously "sleeping".
>
> Yeah, yeah, I know D is proxying for C (while being in the uninterruptible
> sleep state), so may be it is OK then, but I did want to bring this up :-)

I seem to remember Valentin raised similar issue about how userspace view can
get confusing/misleading:

https://www.youtube.com/watch?v=UQNOT20aCEg&t=3h21m41s


Cheers

--
Qais Yousef