public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wander Lairson Costa <wander@redhat.com>
To: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org (open list:SCHEDULER)
Cc: Wander Lairson Costa <wander@redhat.com>
Subject: [PATCH 2/3] sched/deadline: avoid redundant check for boosted task
Date: Mon, 22 Jul 2024 10:29:26 -0300	[thread overview]
Message-ID: <20240722132935.14426-3-wander@redhat.com> (raw)
In-Reply-To: <20240722132935.14426-1-wander@redhat.com>

enqueue_dl_entity only calls setup_new_dl_entity if the task is not
boosted, so the WARN_ON check is unnecessary.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
---
 kernel/sched/deadline.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 312e8fa7ce94..908d5ce79425 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -785,12 +785,11 @@ static inline void replenish_dl_new_period(struct sched_dl_entity *dl_se,
  * one, and to (try to!) reconcile itself with its own scheduling
  * parameters.
  */
-static inline void setup_new_dl_entity(struct sched_dl_entity *dl_se)
+static inline void __setup_new_dl_entity(struct sched_dl_entity *dl_se)
 {
 	struct dl_rq *dl_rq = dl_rq_of_se(dl_se);
 	struct rq *rq = rq_of_dl_rq(dl_rq);
 
-	WARN_ON(is_dl_boosted(dl_se));
 	WARN_ON(dl_time_before(rq_clock(rq), dl_se->deadline));
 
 	/*
@@ -809,6 +808,12 @@ static inline void setup_new_dl_entity(struct sched_dl_entity *dl_se)
 	replenish_dl_new_period(dl_se, rq);
 }
 
+static inline void setup_new_dl_entity(struct sched_dl_entity *dl_se)
+{
+	WARN_ON(is_dl_boosted(dl_se));
+	__setup_new_dl_entity(dl_se);
+}
+
 /*
  * Pure Earliest Deadline First (EDF) scheduling does not deal with the
  * possibility of a entity lasting more than what it declared, and thus
@@ -1755,7 +1760,7 @@ enqueue_dl_entity(struct sched_dl_entity *dl_se, int flags)
 	} else if ((flags & ENQUEUE_RESTORE) &&
 		   !is_dl_boosted(dl_se) &&
 		   dl_time_before(dl_se->deadline, rq_clock(rq_of_dl_se(dl_se)))) {
-		setup_new_dl_entity(dl_se);
+		__setup_new_dl_entity(dl_se);
 	}
 
 	__enqueue_dl_entity(dl_se);
-- 
2.45.2


  parent reply	other threads:[~2024-07-22 13:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22 13:29 [PATCH 0/3] sched/deadline: fixes and improvements Wander Lairson Costa
2024-07-22 13:29 ` [PATCH 1/3] sched/deadline: Fix warning in migrate_enable for boosted tasks Wander Lairson Costa
2024-07-23  8:50   ` Juri Lelli
2024-07-23 12:28     ` Wander Lairson Costa
2024-07-22 13:29 ` Wander Lairson Costa [this message]
2024-07-23  8:55   ` [PATCH 2/3] sched/deadline: avoid redundant check for boosted task Juri Lelli
2024-07-23 12:27     ` Wander Lairson Costa
2024-07-23 14:42       ` Juri Lelli
2024-07-22 13:29 ` [PATCH 3/3] sched/deadline: Consolidate Timer Cancellation Wander Lairson Costa
2024-07-23  9:15   ` Juri Lelli
2024-07-23 12:33     ` Wander Lairson Costa

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=20240722132935.14426-3-wander@redhat.com \
    --to=wander@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