Skip to content

Commit

Permalink
anolis: sched: Ensure the logic of check_preempt_tick with CONFIG_GRO…
Browse files Browse the repository at this point in the history
…UP_IDENTITY off

ANBZ: torvalds#471

If we turn CONFIG_GROUP_IDENTITY off, is_highclass() will return false, which
will result in that check_preempt_tick() returns immediately, and this is not
right. To solved this problem, we just judge whether
delta_exec < sysctl_sched_min_granularity if CONFIG_GROUP_IDENTITY is off.

Signed-off-by: Peng Wang <rocking@linux.alibaba.com>
Signed-off-by: Cruz Zhao <CruzZhao@linux.alibaba.com>
Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
Acked-by: Michael Wang <yun.wang@linux.alibaba.com>
  • Loading branch information
Peng Wang authored and Cruz Zhao committed Feb 16, 2022
1 parent 533d409 commit baa4bee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -5546,7 +5546,11 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
* narrow margin doesn't have to wait for a full slice.
* This also mitigates buddy induced latencies under load.
*/
#ifdef CONFIG_GROUP_IDENTITY
if (is_highclass(curr) && delta_exec < sysctl_sched_min_granularity)
#else
if (delta_exec < sysctl_sched_min_granularity)
#endif
return;

/* Must be on expel if no next se, and curr won't be expellee */
Expand Down

0 comments on commit baa4bee

Please sign in to comment.