lkml.org 
[lkml]   [2022]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH -next] sched/deadline: Add start_new_instance helper
From
On 8/26/22 05:15, Shang XiaoJing wrote:
> Wrap repeated code in helper function start_new_instance, which set
> the deadline and runtiem of input dl_se based on pi_of(dl_se). Note that
^ runtime
> setup_new_dl_entity originally set the deadline and runtime base on
> dl_se, which should equals to pi_of(dl_se) for non-boosted task.
>
> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
> ---
> kernel/sched/deadline.c | 22 ++++++++++++----------
> 1 file changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 4a40a462717c..5e9c28847610 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -770,6 +770,13 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags);
> static void __dequeue_task_dl(struct rq *rq, struct task_struct *p, int flags);
> static void check_preempt_curr_dl(struct rq *rq, struct task_struct *p, int flags);

again, this is not a good function name. Maybe, dl_replenish_new_period() ?

> +static inline void start_new_instance(struct sched_dl_entity *dl_se, struct rq *rq)
> +{
> + /* for non-boosted task, pi_of(dl_se) == dl_se */
> + dl_se->deadline = rq_clock(rq) + pi_of(dl_se)->dl_deadline;
> + dl_se->runtime = pi_of(dl_se)->dl_runtime;
> +}
> +

-- Daniel

\
 
 \ /
  Last update: 2022-08-26 09:17    [W:0.050 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site