aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <[email protected]>2020-04-22 13:10:04 +0200
committerPeter Zijlstra <[email protected]>2020-06-15 14:10:26 +0200
commit8b700983de82f79e05b2c1136d6513ea4c9b22c4 (patch)
tree6ae6fadb83d60b6f7d460598e317b00c74f11f6e /kernel
parent616d91b68cd56bcb1954b6a5af7d542401fde772 (diff)
sched: Remove sched_set_*() return value
Ingo suggested that since the new sched_set_*() functions are implemented using the 'nocheck' variants, they really shouldn't ever fail, so remove the return value. Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Suggested-by: Ingo Molnar <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcu/rcutorture.c5
-rw-r--r--kernel/sched/core.c12
2 files changed, 7 insertions, 10 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index bbc3c8a9e7b9..b4c1146de414 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -893,10 +893,7 @@ static int rcu_torture_boost(void *arg)
VERBOSE_TOROUT_STRING("rcu_torture_boost started");
/* Set real-time priority. */
- if (sched_set_fifo_low(current) < 0) {
- VERBOSE_TOROUT_STRING("rcu_torture_boost RT prio failed!");
- n_rcu_torture_boost_rterror++;
- }
+ sched_set_fifo_low(current);
init_rcu_head_on_stack(&rbi.rcu);
/* Each pass through the following loop does one boost-test cycle. */
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f882d3d74dad..41d3778ea80e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5183,30 +5183,30 @@ int sched_setscheduler_nocheck(struct task_struct *p, int policy,
* The administrator _MUST_ configure the system, the kernel simply doesn't
* know enough information to make a sensible choice.
*/
-int sched_set_fifo(struct task_struct *p)
+void sched_set_fifo(struct task_struct *p)
{
struct sched_param sp = { .sched_priority = MAX_RT_PRIO / 2 };
- return sched_setscheduler_nocheck(p, SCHED_FIFO, &sp);
+ WARN_ON_ONCE(sched_setscheduler_nocheck(p, SCHED_FIFO, &sp) != 0);
}
EXPORT_SYMBOL_GPL(sched_set_fifo);
/*
* For when you don't much care about FIFO, but want to be above SCHED_NORMAL.
*/
-int sched_set_fifo_low(struct task_struct *p)
+void sched_set_fifo_low(struct task_struct *p)
{
struct sched_param sp = { .sched_priority = 1 };
- return sched_setscheduler_nocheck(p, SCHED_FIFO, &sp);
+ WARN_ON_ONCE(sched_setscheduler_nocheck(p, SCHED_FIFO, &sp) != 0);
}
EXPORT_SYMBOL_GPL(sched_set_fifo_low);
-int sched_set_normal(struct task_struct *p, int nice)
+void sched_set_normal(struct task_struct *p, int nice)
{
struct sched_attr attr = {
.sched_policy = SCHED_NORMAL,
.sched_nice = nice,
};
- return sched_setattr_nocheck(p, &attr);
+ WARN_ON_ONCE(sched_setattr_nocheck(p, &attr) != 0);
}
EXPORT_SYMBOL_GPL(sched_set_normal);