Skip to content

Commit 6e6d6ef

Browse files
author
Peter Zijlstra
committed
sched,psci: Convert to sched_set_fifo*()
Because SCHED_FIFO is a broken scheduler model (see previous patches) take away the priority field, the kernel can't possibly make an informed decision. Effectively changes prio from 99 to 50. XXX this thing is horrific, it basically open-codes a stop-machine and idle. Cc: [email protected] Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Ingo Molnar <[email protected]> Acked-by: Valentin Schneider <[email protected]> Tested-by: Sudeep Holla <[email protected]>
1 parent c9ec052 commit 6e6d6ef

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/firmware/psci/psci_checker.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ static int suspend_test_thread(void *arg)
272272
{
273273
int cpu = (long)arg;
274274
int i, nb_suspend = 0, nb_shallow_sleep = 0, nb_err = 0;
275-
struct sched_param sched_priority = { .sched_priority = MAX_RT_PRIO-1 };
276275
struct cpuidle_device *dev;
277276
struct cpuidle_driver *drv;
278277
/* No need for an actual callback, we just want to wake up the CPU. */
@@ -282,9 +281,8 @@ static int suspend_test_thread(void *arg)
282281
wait_for_completion(&suspend_threads_started);
283282

284283
/* Set maximum priority to preempt all other threads on this CPU. */
285-
if (sched_setscheduler_nocheck(current, SCHED_FIFO, &sched_priority))
286-
pr_warn("Failed to set suspend thread scheduler on CPU %d\n",
287-
cpu);
284+
if (sched_set_fifo(current))
285+
pr_warn("Failed to set suspend thread scheduler on CPU %d\n", cpu);
288286

289287
dev = this_cpu_read(cpuidle_devices);
290288
drv = cpuidle_get_cpu_driver(dev);
@@ -349,11 +347,6 @@ static int suspend_test_thread(void *arg)
349347
if (atomic_dec_return_relaxed(&nb_active_threads) == 0)
350348
complete(&suspend_threads_done);
351349

352-
/* Give up on RT scheduling and wait for termination. */
353-
sched_priority.sched_priority = 0;
354-
if (sched_setscheduler_nocheck(current, SCHED_NORMAL, &sched_priority))
355-
pr_warn("Failed to set suspend thread scheduler on CPU %d\n",
356-
cpu);
357350
for (;;) {
358351
/* Needs to be set first to avoid missing a wakeup. */
359352
set_current_state(TASK_INTERRUPTIBLE);

0 commit comments

Comments
 (0)