Merge tag 'sched-fifo-2020-08-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull sched/fifo updates from Ingo Molnar: "This adds the sched_set_fifo*() encapsulation APIs to remove static priority level knowledge from non-scheduler code. The three APIs for non-scheduler code to set SCHED_FIFO are: - sched_set_fifo() - sched_set_fifo_low() - sched_set_normal() These are two FIFO priority levels: default (high), and a 'low' priority level, plus sched_set_normal() to set the policy back to non-SCHED_FIFO. Since the changes affect a lot of non-scheduler code, we kept this in a separate tree" * tag 'sched-fifo-2020-08-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits) sched,tracing: Convert to sched_set_fifo() sched: Remove sched_set_*() return value sched: Remove sched_setscheduler*() EXPORTs sched,psi: Convert to sched_set_fifo_low() sched,rcutorture: Convert to sched_set_fifo_low() sched,rcuperf: Convert to sched_set_fifo_low() sched,locktorture: Convert to sched_set_fifo() sched,irq: Convert to sched_set_fifo() sched,watchdog: Convert to sched_set_fifo() sched,serial: Convert to sched_set_fifo() sched,powerclamp: Convert to sched_set_fifo() sched,ion: Convert to sched_set_normal() sched,powercap: Convert to sched_set_fifo*() sched,spi: Convert to sched_set_fifo*() sched,mmc: Convert to sched_set_fifo*() sched,ivtv: Convert to sched_set_fifo*() sched,drm/scheduler: Convert to sched_set_fifo*() sched,msm: Convert to sched_set_fifo*() sched,psci: Convert to sched_set_fifo*() sched,drbd: Convert to sched_set_fifo*() ...
This commit is contained in:
@@ -274,7 +274,6 @@ static int suspend_test_thread(void *arg)
|
||||
{
|
||||
int cpu = (long)arg;
|
||||
int i, nb_suspend = 0, nb_shallow_sleep = 0, nb_err = 0;
|
||||
struct sched_param sched_priority = { .sched_priority = MAX_RT_PRIO-1 };
|
||||
struct cpuidle_device *dev;
|
||||
struct cpuidle_driver *drv;
|
||||
/* No need for an actual callback, we just want to wake up the CPU. */
|
||||
@@ -284,9 +283,7 @@ static int suspend_test_thread(void *arg)
|
||||
wait_for_completion(&suspend_threads_started);
|
||||
|
||||
/* Set maximum priority to preempt all other threads on this CPU. */
|
||||
if (sched_setscheduler_nocheck(current, SCHED_FIFO, &sched_priority))
|
||||
pr_warn("Failed to set suspend thread scheduler on CPU %d\n",
|
||||
cpu);
|
||||
sched_set_fifo(current);
|
||||
|
||||
dev = this_cpu_read(cpuidle_devices);
|
||||
drv = cpuidle_get_cpu_driver(dev);
|
||||
@@ -351,11 +348,6 @@ static int suspend_test_thread(void *arg)
|
||||
if (atomic_dec_return_relaxed(&nb_active_threads) == 0)
|
||||
complete(&suspend_threads_done);
|
||||
|
||||
/* Give up on RT scheduling and wait for termination. */
|
||||
sched_priority.sched_priority = 0;
|
||||
if (sched_setscheduler_nocheck(current, SCHED_NORMAL, &sched_priority))
|
||||
pr_warn("Failed to set suspend thread scheduler on CPU %d\n",
|
||||
cpu);
|
||||
for (;;) {
|
||||
/* Needs to be set first to avoid missing a wakeup. */
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
|
Reference in New Issue
Block a user