lkml.org 
[lkml]   [2022]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/fair: optimize entity_tick()
On Mon, Jul 18, 2022 at 05:49:37PM +0800, Peng Zhang wrote:
> From: "zhangpeng.00" <zhangpeng.00@bytedance.com>
>
> entity_tick() will be called to check preemption by calculating each
> sched_entity's time_slice in a task group tree from bottom to top.
>
> If a need_resched_flag is set by a checking of a sched_entity,
> there is no necessary to check preemption of the sched_entity's
> parent and ancestor entity.
>
> So we can test if the need_resched_flag has been set before calling
> check_preempt_tick() to avoid unnecessary calculations.
>
> Signed-off-by: zhangpeng.00 <zhangpeng.00@bytedance.com>

Optimization patches should come with numbers showing they're worth it.

Also; did you consider side-effects from check_preempt_tick(), like
clearing buddy state etc.. ?

\
 
 \ /
  Last update: 2022-07-18 12:11    [W:0.043 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site