From: shangxiaojing <shangxiaojing@huawei.com>
To: Daniel Bristot de Oliveira <bristot@redhat.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 15:40:04 +0800 [thread overview]
Message-ID: <893836a5-0aaa-e5e6-81ba-cc9570b9a026@huawei.com> (raw)
In-Reply-To: <651dbb96-8d6e-53e9-a99f-0bb12f5b2723@redhat.com>
On 2022/8/26 15:15, Daniel Bristot de Oliveira wrote:
> 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
oops
>> 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() ?
right, i have thought like replenish_new_instance, but when i'm making
patch, i was worried that "replenish" is only for ENQUEUE_REPLENISH.
what about dl_start_new_period? which means a new deadline will be set,
rather than
dl_se->deadline += pi_of(dl_se)->dl_period;
in replenish_dl_entity.
>> +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
Thanks,
Shang XiaoJing
next prev parent reply other threads:[~2022-08-26 7:40 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
2022-08-26 7:40 ` shangxiaojing [this message]
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=893836a5-0aaa-e5e6-81ba-cc9570b9a026@huawei.com \
--to=shangxiaojing@huawei.com \
--cc=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=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®