From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Jiang Biao <benbjiang@gmail.com>,
mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org
Cc: rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
linux-kernel@vger.kernel.org, Jiang Biao <benbjiang@tencent.com>
Subject: Re: [PATCH] sched/fair: Optimize dequeue_task_fair()
Date: Tue, 11 Aug 2020 18:55:05 +0200 [thread overview]
Message-ID: <9a2ddb2d-4c9a-a85d-cba2-0956b6d953c0@arm.com> (raw)
In-Reply-To: <20200811084310.27130-1-benbjiang@tencent.com>
On 11/08/2020 10:43, Jiang Biao wrote:
> Similar optimization as what has been done in commit,
> 7d148be69e3a(sched/fair: Optimize enqueue_task_fair())
>
> dequeue_task_fair jumps to dequeue_throttle label when cfs_rq_of(se) is
> throttled which means that se can't be NULL. We can move the label after
> the if (!se) statement and remove the if(!se) statment as se is always
> NULL when reaching this point.
>
> Besides, trying to keep the same pattern with enqueue_task_fair can make
> it more readable.
>
> Signed-off-by: Jiang Biao <benbjiang@tencent.com>
> ---
> kernel/sched/fair.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 04fa8dbcfa4d..cbbeafdfa8b7 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -5618,10 +5618,10 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
>
> }
>
> -dequeue_throttle:
> - if (!se)
> - sub_nr_running(rq, 1);
> + /* At this point se is NULL and we are at root level*/
> + sub_nr_running(rq, 1);
>
> +dequeue_throttle:
> /* balance early to pull high priority tasks */
> if (unlikely(!was_sched_idle && sched_idle_rq(rq)))
> rq->next_balance = jiffies;
There is already a similar patch in master.
423d02e1463b - sched/fair: Optimize dequeue_task_fair() (2020-06-25 Peng
Wang)
next prev parent reply other threads:[~2020-08-11 16:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 8:43 [PATCH] sched/fair: Optimize dequeue_task_fair() Jiang Biao
2020-08-11 16:55 ` Dietmar Eggemann [this message]
2020-08-11 23:18 ` [PATCH] sched/fair: Optimize dequeue_task_fair()(Internet mail) benbjiang(蒋彪)
-- strict thread matches above, loose matches on Subject: below --
2020-06-15 14:16 [PATCH] sched/fair: Optimize dequeue_task_fair() Peng Wang
2020-06-15 15:09 ` Vincent Guittot
2020-06-16 6:09 ` Peng Wang
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=9a2ddb2d-4c9a-a85d-cba2-0956b6d953c0@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=benbjiang@gmail.com \
--cc=benbjiang@tencent.com \
--cc=bsegall@google.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 \
/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).