public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiang Biao <benbjiang@gmail.com>
To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org
Cc: dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de,
	linux-kernel@vger.kernel.org, Jiang Biao <benbjiang@tencent.com>
Subject: [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task
Date: Thu, 20 Aug 2020 20:00:25 +0800	[thread overview]
Message-ID: <20200820120025.74460-1-benbjiang@tencent.com> (raw)

From: Jiang Biao <benbjiang@tencent.com>

Vruntime compensation has been down in place_entity() to
boot the waking procedure for fair tasks. There is no need to
do that for SCHED_IDLE task actually.

Not compensating vruntime for SCHED_IDLE task could make
SCHED_IDLE task more harmless for normal tasks.

Signed-off-by: Jiang Biao <benbjiang@tencent.com>
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 1a68a0536add..adff77676a0a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4115,7 +4115,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
 		vruntime += sched_vslice(cfs_rq, se);
 
 	/* sleeps up to a single latency don't count. */
-	if (!initial) {
+	if (!initial && likely(!task_has_idle_policy(task_of(se)))) {
 		unsigned long thresh = sysctl_sched_latency;
 
 		/*
-- 
2.21.0


             reply	other threads:[~2020-08-20 12:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 12:00 Jiang Biao [this message]
2020-08-20 12:51 ` [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task Vincent Guittot
2020-08-20 12:58   ` peterz
2020-08-20 13:15     ` Vincent Guittot
2020-08-20 13:43       ` peterz
2020-08-20 14:09         ` Vincent Guittot
2020-08-20 14:24           ` Jiang Biao
2020-08-23  7:33           ` Jiang Biao
2020-08-28 12:55             ` Vincent Guittot
2020-09-01 10:14               ` Jiang Biao
2020-09-01 13:04                 ` Vincent Guittot
2020-09-01 14:19                   ` Jiang Biao
2020-08-20 14:19     ` Jiang Biao
2020-08-20 14:15   ` Jiang Biao
2020-08-21  0:37 ` [sched/fair] 88d13f778f: WARNING:at_kernel/sched/fair.c:#place_entity kernel test robot

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=20200820120025.74460-1-benbjiang@tencent.com \
    --to=benbjiang@gmail.com \
    --cc=benbjiang@tencent.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 \
    /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