[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5667632.X0gI6VCO9r@mobilepool36.emlix.com>
Date: Tue, 29 Mar 2022 09:44:30 +0200
From: Rolf Eike Beer <eb@...ix.com>
To: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] sched: use TASK_USER_PRIO() instead of open coding it
Signed-off-by: Rolf Eike Beer <eb@...ix.com>
---
kernel/sched/core.c | 2 +-
kernel/trace/trace.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d575b4914925..c01c49aa4e77 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1281,7 +1281,7 @@ int tg_nop(struct task_group *tg, void *data)
static void set_load_weight(struct task_struct *p, bool update_load)
{
- int prio = p->static_prio - MAX_RT_PRIO;
+ int prio = TASK_USER_PRIO(p);
struct load_weight *load = &p->se.load;
/*
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f4de111fa18f..f8ab47a87fd0 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1782,7 +1782,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
else
max_data->uid = task_uid(tsk);
- max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
+ max_data->nice = TASK_USER_PRIO(tsk) - 20;
max_data->policy = tsk->policy;
max_data->rt_priority = tsk->rt_priority;
--
2.35.1
--
Rolf Eike Beer, emlix GmbH, https://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055
emlix - smart embedded open source
Powered by blists - more mailing lists