lkml.org 
[lkml]   [2022]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v7 5/9] sched/fair: Take into account latency priority at wakeup
From

> /*
> * Preempt the current task with a newly woken task if needed:
> */
> @@ -4566,7 +4568,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
> {
> unsigned long ideal_runtime, delta_exec;
> struct sched_entity *se;
> - s64 delta;
> + s64 delta, offset;
>
> ideal_runtime = sched_slice(cfs_rq, curr);
> delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
> @@ -4591,10 +4593,12 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
> se = __pick_first_entity(cfs_rq);
> delta = curr->vruntime - se->vruntime;
>
> - if (delta < 0)
> + offset = wakeup_latency_gran(curr, se);
> + if (delta < offset)
> return;
>
> - if (delta > ideal_runtime)
> + if ((delta > ideal_runtime) ||
> + (delta > get_latency_max()))
> resched_curr(rq_of(cfs_rq));
> }
>
>
Hi Vincent,

I am not sure if i have understood this below change correctly.

wakeup_latency_gran - this function returns difference in latency nice offsets.
Hence the more negative the value, it means se has more latency requirement
compared to current. Hence se should preempt the current here right?

we are comparing delta to get_latency_max and ideal_runtime, both of which can
be higher positive value, hence we will not preempt. that is not what we want
right?

\
 
 \ /
  Last update: 2022-11-13 09:52    [W:0.240 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site