Commit 93db9129 authored by Peter Zijlstra's avatar Peter Zijlstra

sched,locktorture: 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.

Cc: paulmck@kernel.org
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarIngo Molnar <mingo@kernel.org>
Reviewed-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 7a40798c
...@@ -436,8 +436,6 @@ static int torture_rtmutex_lock(void) __acquires(torture_rtmutex) ...@@ -436,8 +436,6 @@ static int torture_rtmutex_lock(void) __acquires(torture_rtmutex)
static void torture_rtmutex_boost(struct torture_random_state *trsp) static void torture_rtmutex_boost(struct torture_random_state *trsp)
{ {
int policy;
struct sched_param param;
const unsigned int factor = 50000; /* yes, quite arbitrary */ const unsigned int factor = 50000; /* yes, quite arbitrary */
if (!rt_task(current)) { if (!rt_task(current)) {
...@@ -448,8 +446,7 @@ static void torture_rtmutex_boost(struct torture_random_state *trsp) ...@@ -448,8 +446,7 @@ static void torture_rtmutex_boost(struct torture_random_state *trsp)
*/ */
if (trsp && !(torture_random(trsp) % if (trsp && !(torture_random(trsp) %
(cxt.nrealwriters_stress * factor))) { (cxt.nrealwriters_stress * factor))) {
policy = SCHED_FIFO; sched_set_fifo(current);
param.sched_priority = MAX_RT_PRIO - 1;
} else /* common case, do nothing */ } else /* common case, do nothing */
return; return;
} else { } else {
...@@ -462,13 +459,10 @@ static void torture_rtmutex_boost(struct torture_random_state *trsp) ...@@ -462,13 +459,10 @@ static void torture_rtmutex_boost(struct torture_random_state *trsp)
*/ */
if (!trsp || !(torture_random(trsp) % if (!trsp || !(torture_random(trsp) %
(cxt.nrealwriters_stress * factor * 2))) { (cxt.nrealwriters_stress * factor * 2))) {
policy = SCHED_NORMAL; sched_set_normal(current, 0);
param.sched_priority = 0;
} else /* common case, do nothing */ } else /* common case, do nothing */
return; return;
} }
sched_setscheduler_nocheck(current, policy, &param);
} }
static void torture_rtmutex_delay(struct torture_random_state *trsp) static void torture_rtmutex_delay(struct torture_random_state *trsp)
......
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