public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: peterz@infradead.org
To: mingo@kernel.org
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	vincent.guittot@linaro.org, juri.lelli@redhat.com,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
	corbet@lwn.net, qyousef@layalina.io, chris.hyser@oracle.com,
	patrick.bellasi@matbug.net, pjt@google.com, pavel@ucw.cz,
	qperret@google.com, tim.c.chen@linux.intel.com,
	joshdon@google.com, timj@gnu.org, kprateek.nayak@amd.com,
	yu.c.chen@intel.com, youssefesmat@chromium.org,
	joel@joelfernandes.org, efault@gmx.de, tglx@linutronix.de,
	daniel.m.jordan@oracle.com
Subject: [PATCH 1/2] sched/eevdf: Also update slice on placement
Date: Fri, 15 Sep 2023 14:43:55 +0200	[thread overview]
Message-ID: <20230915124822.847197830@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: 20230915124354.416936110@noisy.programming.kicks-ass.net

[-- Attachment #1: peterz-sched-eevdf-slice-update.patch --]
[-- Type: text/plain, Size: 1128 bytes --]

Tasks that never consume their full slice would not update their slice value.
This means that tasks that are spawned before the sysctl scaling keep their
original (UP) slice length.

Fixes: 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 kernel/sched/fair.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6/kernel/sched/fair.c
===================================================================
--- linux-2.6.orig/kernel/sched/fair.c
+++ linux-2.6/kernel/sched/fair.c
@@ -4919,10 +4919,12 @@ static inline void update_misfit_status(
 static void
 place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
 {
-	u64 vslice = calc_delta_fair(se->slice, se);
-	u64 vruntime = avg_vruntime(cfs_rq);
+	u64 vslice, vruntime = avg_vruntime(cfs_rq);
 	s64 lag = 0;
 
+	se->slice = sysctl_sched_base_slice;
+	vslice = calc_delta_fair(se->slice, se);
+
 	/*
 	 * Due to how V is constructed as the weighted average of entities,
 	 * adding tasks with positive lag, or removing tasks with negative lag



  reply	other threads:[~2023-09-15 12:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 12:43 [PATCH 0/2] sched/eevdf: sched_attr::sched_runtime slice hint peterz
2023-09-15 12:43 ` peterz [this message]
2023-10-03 10:42   ` [tip: sched/urgent] sched/eevdf: Also update slice on placement tip-bot2 for Peter Zijlstra
2023-09-15 12:43 ` [PATCH 2/2] sched/eevdf: Use sched_attr::sched_runtime to set request/slice suggestion peterz
2023-09-19  7:53   ` Mike Galbraith
2023-09-24  9:21     ` Mike Galbraith
2023-09-19 22:07   ` Qais Yousef
2023-09-19 22:37     ` Peter Zijlstra
2023-09-20  0:45       ` Qais Yousef
2023-12-10 22:47       ` Qais Yousef
2023-09-16 21:33 ` [PATCH 0/2] sched/eevdf: sched_attr::sched_runtime slice hint Qais Yousef
2023-09-18  3:43   ` Mike Galbraith
2023-09-19 21:08     ` Qais Yousef
2023-09-20  4:02       ` Mike Galbraith

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=20230915124822.847197830@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=chris.hyser@oracle.com \
    --cc=corbet@lwn.net \
    --cc=daniel.m.jordan@oracle.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=efault@gmx.de \
    --cc=joel@joelfernandes.org \
    --cc=joshdon@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=patrick.bellasi@matbug.net \
    --cc=pavel@ucw.cz \
    --cc=pjt@google.com \
    --cc=qperret@google.com \
    --cc=qyousef@layalina.io \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=timj@gnu.org \
    --cc=vincent.guittot@linaro.org \
    --cc=youssefesmat@chromium.org \
    --cc=yu.c.chen@intel.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