[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <157658639295.30329.4061098261424663170.tip-bot2@tip-bot2>
Date: Tue, 17 Dec 2019 12:39:52 -0000
From: "tip-bot2 for Frederic Weisbecker" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <frederic@...nel.org>,
Ingo Molnar <mingo@...nel.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: sched/core] sched: Use fair:prio_changed() instead of ad-hoc
implementation
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 5443a0be6121d557e12951537e10159e4c61035d
Gitweb: https://git.kernel.org/tip/5443a0be6121d557e12951537e10159e4c61035d
Author: Frederic Weisbecker <frederic@...nel.org>
AuthorDate: Tue, 03 Dec 2019 17:01:06 +01:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Tue, 17 Dec 2019 13:32:50 +01:00
sched: Use fair:prio_changed() instead of ad-hoc implementation
set_user_nice() implements its own version of fair::prio_changed() and
therefore misses a specific optimization towards nohz_full CPUs that
avoid sending an resched IPI to a reniced task running alone. Use the
proper callback instead.
Reported-by: Peter Zijlstra <peterz@...radead.org>
Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>
Link: https://lkml.kernel.org/r/20191203160106.18806-3-frederic@kernel.org
---
kernel/sched/core.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 90e4b00..15508c2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4540,17 +4540,17 @@ void set_user_nice(struct task_struct *p, long nice)
p->prio = effective_prio(p);
delta = p->prio - old_prio;
- if (queued) {
+ if (queued)
enqueue_task(rq, p, ENQUEUE_RESTORE | ENQUEUE_NOCLOCK);
- /*
- * If the task increased its priority or is running and
- * lowered its priority, then reschedule its CPU:
- */
- if (delta < 0 || (delta > 0 && task_running(rq, p)))
- resched_curr(rq);
- }
if (running)
set_next_task(rq, p);
+
+ /*
+ * If the task increased its priority or is running and
+ * lowered its priority, then reschedule its CPU:
+ */
+ p->sched_class->prio_changed(rq, p, old_prio);
+
out_unlock:
task_rq_unlock(rq, p, &rf);
}
Powered by blists - more mailing lists