linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shangxiaojing <shangxiaojing@huawei.com>
To: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: <mingo@redhat.com>, <peterz@infradead.org>,
	<vincent.guittot@linaro.org>, <juri.lelli@redhat.com>,
	<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 compare_task_rq helper
Date: Fri, 26 Aug 2022 15:23:52 +0800	[thread overview]
Message-ID: <93f6bfae-7c2c-69e5-720c-89ba63e3a3fe@huawei.com> (raw)
In-Reply-To: <c5d40522-037d-e324-697b-23e5e4686d58@redhat.com>


On 2022/8/26 15:10, Daniel Bristot de Oliveira wrote:
> On 8/26/22 05:11, Shang XiaoJing wrote:
>> Wrap repeated code in helper function compare_task_rq, which return true
>> if there is no deadline task on the rq at all, or task's deadline
>> earlier than the rq.
>>
>> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
>> ---
>>   kernel/sched/deadline.c | 23 +++++++++++------------
>>   1 file changed, 11 insertions(+), 12 deletions(-)
>>
>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
>> index d116d2b9d2f9..4a40a462717c 100644
>> --- a/kernel/sched/deadline.c
>> +++ b/kernel/sched/deadline.c
>> @@ -1810,6 +1810,13 @@ static void yield_task_dl(struct rq *rq)
>>   
>>   #ifdef CONFIG_SMP
> I see the value of this helper, but "compare_task_rq" is making things more confuse.
>
> Choose a more descriptive name, like, dl_task_is_earliest_deadline() ?

ok, i'll find a better name, or take your advice directly in v2.

>> +static inline bool compare_task_rq(struct task_struct *p, struct rq *rq)
>> +{
>> +	return (!rq->dl.dl_nr_running ||
>> +		dl_time_before(p->dl.deadline,
>> +			       rq->dl.earliest_dl.curr));
>> +}
>> +
> -- Daniel

Thanks :-) ,

Shang XiaoJing


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  3:11 [PATCH -next] sched/deadline: Add compare_task_rq helper Shang XiaoJing
2022-08-26  7:10 ` Daniel Bristot de Oliveira
2022-08-26  7:23   ` shangxiaojing [this message]

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=93f6bfae-7c2c-69e5-720c-89ba63e3a3fe@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;
as well as URLs for NNTP newsgroup(s).