[v3,0/3] Use update_current_exec_runtime simplify code

Message ID 20231031125928.235685-1-yajun.deng@linux.dev
Headers
Series Use update_current_exec_runtime simplify code |

Message

Yajun Deng Oct. 31, 2023, 12:59 p.m. UTC
  update_current_exec_runtime would update execution time for each task,
we can use update_current_exec_runtime simplify code.

The 1st and 2nd patch update update_current_exec_runtime() applies to all
callers.
The 3rd patch use update_current_exec_runtime simplify update_curr.

Yajun Deng (3):
  sched: Don't account execution time for task group
  sched: Don't trace stat runtime for task group
  sched/fair: Simplify update_curr()

 kernel/sched/deadline.c  |  4 +---
 kernel/sched/fair.c      | 13 +++----------
 kernel/sched/rt.c        |  5 ++---
 kernel/sched/sched.h     | 11 +++++++----
 kernel/sched/stop_task.c |  2 +-
 5 files changed, 14 insertions(+), 21 deletions(-)
  

Comments

Peter Zijlstra Nov. 6, 2023, 12:35 p.m. UTC | #1
On Tue, Oct 31, 2023 at 08:59:25PM +0800, Yajun Deng wrote:
> update_current_exec_runtime would update execution time for each task,
> we can use update_current_exec_runtime simplify code.
> 
> The 1st and 2nd patch update update_current_exec_runtime() applies to all
> callers.
> The 3rd patch use update_current_exec_runtime simplify update_curr.
> 
> Yajun Deng (3):
>   sched: Don't account execution time for task group
>   sched: Don't trace stat runtime for task group
>   sched/fair: Simplify update_curr()
> 
>  kernel/sched/deadline.c  |  4 +---
>  kernel/sched/fair.c      | 13 +++----------
>  kernel/sched/rt.c        |  5 ++---
>  kernel/sched/sched.h     | 11 +++++++----
>  kernel/sched/stop_task.c |  2 +-
>  5 files changed, 14 insertions(+), 21 deletions(-)


Hurmph, so I'm having conflicts against this:

  https://lkml.kernel.org/r/54d148a144f26d9559698c4dd82d8859038a7380.1699095159.git.bristot@kernel.org

(obviously).. I've resolved the first patch, which also mostly includes
the second patch.

However, your second patch isn't entirely right, it now unconditionally
traces ->vruntime, which isn't the same. Imagine a regular task getting
a PI boost to RT, in that case ->vruntime will be non-zero and the RT
task will now be logging a vruntime.

Anyway, that tracepoint doesn't really make sense to me anyway, that is,
it logs a delta_exec and an absolute vruntime, that's inconsistent.
Also, a delta vruntime can be easily computed because the weight should
be known.

I think I'm going to simply remove the vruntime from that tracepoint and
avoid the whole problem.

This then also makes resolving patch 3 easier.

Let me go squish all this and then I'll post a link to whatever came
out.
  
Yajun Deng Nov. 7, 2023, 3:39 a.m. UTC | #2
On 2023/11/6 20:35, Peter Zijlstra wrote:
> On Tue, Oct 31, 2023 at 08:59:25PM +0800, Yajun Deng wrote:
>> update_current_exec_runtime would update execution time for each task,
>> we can use update_current_exec_runtime simplify code.
>>
>> The 1st and 2nd patch update update_current_exec_runtime() applies to all
>> callers.
>> The 3rd patch use update_current_exec_runtime simplify update_curr.
>>
>> Yajun Deng (3):
>>    sched: Don't account execution time for task group
>>    sched: Don't trace stat runtime for task group
>>    sched/fair: Simplify update_curr()
>>
>>   kernel/sched/deadline.c  |  4 +---
>>   kernel/sched/fair.c      | 13 +++----------
>>   kernel/sched/rt.c        |  5 ++---
>>   kernel/sched/sched.h     | 11 +++++++----
>>   kernel/sched/stop_task.c |  2 +-
>>   5 files changed, 14 insertions(+), 21 deletions(-)
>
> Hurmph, so I'm having conflicts against this:
>
>    https://lkml.kernel.org/r/54d148a144f26d9559698c4dd82d8859038a7380.1699095159.git.bristot@kernel.org
>
> (obviously).. I've resolved the first patch, which also mostly includes
> the second patch.
>
> However, your second patch isn't entirely right, it now unconditionally
> traces ->vruntime, which isn't the same. Imagine a regular task getting
> a PI boost to RT, in that case ->vruntime will be non-zero and the RT
> task will now be logging a vruntime.
>
> Anyway, that tracepoint doesn't really make sense to me anyway, that is,
> it logs a delta_exec and an absolute vruntime, that's inconsistent.
> Also, a delta vruntime can be easily computed because the weight should
> be known.
>
> I think I'm going to simply remove the vruntime from that tracepoint and
> avoid the whole problem.
>
> This then also makes resolving patch 3 easier.
>
> Let me go squish all this and then I'll post a link to whatever came
> out.


Got it, thanks!