Commit 8b700983 authored by Peter Zijlstra's avatar Peter Zijlstra

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: axboe@kernel.dk
Cc: daniel.lezcano@linaro.org
Cc: sudeep.holla@arm.com
Cc: airlied@redhat.com
Cc: broonie@kernel.org
Cc: paulmck@kernel.org
Suggested-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarIngo Molnar <mingo@kernel.org>
parent 616d91b6
...@@ -6020,9 +6020,7 @@ int drbd_ack_receiver(struct drbd_thread *thi) ...@@ -6020,9 +6020,7 @@ int drbd_ack_receiver(struct drbd_thread *thi)
int expect = header_size; int expect = header_size;
bool ping_timeout_active = false; bool ping_timeout_active = false;
rv = sched_set_fifo_low(current); sched_set_fifo_low(current);
if (rv < 0)
drbd_err(connection, "drbd_ack_receiver: ERROR set priority, ret=%d\n", rv);
while (get_t_state(thi) == RUNNING) { while (get_t_state(thi) == RUNNING) {
drbd_thread_current_set_cpu(thi); drbd_thread_current_set_cpu(thi);
......
...@@ -281,8 +281,7 @@ static int suspend_test_thread(void *arg) ...@@ -281,8 +281,7 @@ static int suspend_test_thread(void *arg)
wait_for_completion(&suspend_threads_started); wait_for_completion(&suspend_threads_started);
/* Set maximum priority to preempt all other threads on this CPU. */ /* Set maximum priority to preempt all other threads on this CPU. */
if (sched_set_fifo(current)) sched_set_fifo(current);
pr_warn("Failed to set suspend thread scheduler on CPU %d\n", cpu);
dev = this_cpu_read(cpuidle_devices); dev = this_cpu_read(cpuidle_devices);
drv = cpuidle_get_cpu_driver(dev); drv = cpuidle_get_cpu_driver(dev);
......
...@@ -509,10 +509,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) ...@@ -509,10 +509,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
goto err_msm_uninit; goto err_msm_uninit;
} }
ret = sched_set_fifo(priv->event_thread[i].thread); sched_set_fifo(priv->event_thread[i].thread);
if (ret)
dev_warn(dev, "event_thread set priority failed:%d\n",
ret);
} }
ret = drm_vblank_init(ddev, priv->num_crtcs); ret = drm_vblank_init(ddev, priv->num_crtcs);
......
...@@ -725,10 +725,9 @@ static int cros_ec_spi_devm_high_pri_alloc(struct device *dev, ...@@ -725,10 +725,9 @@ static int cros_ec_spi_devm_high_pri_alloc(struct device *dev,
if (err) if (err)
return err; return err;
err = sched_set_fifo(ec_spi->high_pri_worker->task); sched_set_fifo(ec_spi->high_pri_worker->task);
if (err)
dev_err(dev, "Can't set cros_ec high pri priority: %d\n", err); return 0;
return err;
} }
static int cros_ec_spi_probe(struct spi_device *spi) static int cros_ec_spi_probe(struct spi_device *spi)
......
...@@ -1653,9 +1653,9 @@ extern int idle_cpu(int cpu); ...@@ -1653,9 +1653,9 @@ extern int idle_cpu(int cpu);
extern int available_idle_cpu(int cpu); extern int available_idle_cpu(int cpu);
extern int sched_setscheduler(struct task_struct *, int, const struct sched_param *); extern int sched_setscheduler(struct task_struct *, int, const struct sched_param *);
extern int sched_setscheduler_nocheck(struct task_struct *, int, const struct sched_param *); extern int sched_setscheduler_nocheck(struct task_struct *, int, const struct sched_param *);
extern int sched_set_fifo(struct task_struct *p); extern void sched_set_fifo(struct task_struct *p);
extern int sched_set_fifo_low(struct task_struct *p); extern void sched_set_fifo_low(struct task_struct *p);
extern int sched_set_normal(struct task_struct *p, int nice); extern void sched_set_normal(struct task_struct *p, int nice);
extern int sched_setattr(struct task_struct *, const struct sched_attr *); extern int sched_setattr(struct task_struct *, const struct sched_attr *);
extern int sched_setattr_nocheck(struct task_struct *, const struct sched_attr *); extern int sched_setattr_nocheck(struct task_struct *, const struct sched_attr *);
extern struct task_struct *idle_task(int cpu); extern struct task_struct *idle_task(int cpu);
......
...@@ -893,10 +893,7 @@ static int rcu_torture_boost(void *arg) ...@@ -893,10 +893,7 @@ static int rcu_torture_boost(void *arg)
VERBOSE_TOROUT_STRING("rcu_torture_boost started"); VERBOSE_TOROUT_STRING("rcu_torture_boost started");
/* Set real-time priority. */ /* Set real-time priority. */
if (sched_set_fifo_low(current) < 0) { sched_set_fifo_low(current);
VERBOSE_TOROUT_STRING("rcu_torture_boost RT prio failed!");
n_rcu_torture_boost_rterror++;
}
init_rcu_head_on_stack(&rbi.rcu); init_rcu_head_on_stack(&rbi.rcu);
/* Each pass through the following loop does one boost-test cycle. */ /* Each pass through the following loop does one boost-test cycle. */
......
...@@ -5183,30 +5183,30 @@ int sched_setscheduler_nocheck(struct task_struct *p, int policy, ...@@ -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 * The administrator _MUST_ configure the system, the kernel simply doesn't
* know enough information to make a sensible choice. * 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 }; 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); EXPORT_SYMBOL_GPL(sched_set_fifo);
/* /*
* For when you don't much care about FIFO, but want to be above SCHED_NORMAL. * 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 }; 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); 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 = { struct sched_attr attr = {
.sched_policy = SCHED_NORMAL, .sched_policy = SCHED_NORMAL,
.sched_nice = nice, .sched_nice = nice,
}; };
return sched_setattr_nocheck(p, &attr); WARN_ON_ONCE(sched_setattr_nocheck(p, &attr) != 0);
} }
EXPORT_SYMBOL_GPL(sched_set_normal); EXPORT_SYMBOL_GPL(sched_set_normal);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment