Skip to content
Permalink
Browse files
sched/fair:Reduce unnecessary check preempt in the sched tick
If it has been determined that the current cpu need resched in the
early stage of for_each_sched_entity, then there is no need to check
preempt in the subsequent se->parent entity_tick.

Signed-off-by: jun qian <qianjun.kernel@gmail.com>
  • Loading branch information
jun qian authored and intel-lab-lkp committed Apr 13, 2021
1 parent 4aed8aa commit dbe8fdaf74553572909be6f118565862c4cdfac5
Showing 1 changed file with 5 additions and 0 deletions.
@@ -4379,8 +4379,13 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
{
unsigned long ideal_runtime, delta_exec;
struct sched_entity *se;
struct rq *rq = rq_of(cfs_rq);
s64 delta;

/* If the TIF_NEED_RESCHED has been set, it is no need to check again */
if (test_tsk_need_resched(rq->curr))
return;

ideal_runtime = sched_slice(cfs_rq, curr);
delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
if (delta_exec > ideal_runtime) {

0 comments on commit dbe8fda

Please sign in to comment.