Messages in this thread | | | Date | Mon, 18 Jul 2022 12:10:29 +0200 | From | Peter Zijlstra <> | Subject | Re: [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.. ?
| |