mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Bristot de Oliveira <bristot@redhat.com>
To: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] sched/deadline: Add start_new_instance helper
Date: Fri, 26 Aug 2022 09:15:38 +0200	[thread overview]
Message-ID: <651dbb96-8d6e-53e9-a99f-0bb12f5b2723@redhat.com> (raw)
In-Reply-To: <20220826031521.13391-1-shangxiaojing@huawei.com>

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


  reply	other threads:[~2022-08-26  7:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  3:15 Shang XiaoJing
2022-08-26  7:15 ` Daniel Bristot de Oliveira [this message]
2022-08-26  7:40   ` shangxiaojing
2022-08-26  8:57     ` Daniel Bristot de Oliveira
2022-08-26  9:09       ` shangxiaojing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=651dbb96-8d6e-53e9-a99f-0bb12f5b2723@redhat.com \
    --to=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=shangxiaojing@huawei.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®