Skip to content

Commit 93db912

Browse files
author
Peter Zijlstra
committed
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: [email protected] Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Ingo Molnar <[email protected]> Reviewed-by: Paul E. McKenney <[email protected]>
1 parent 7a40798 commit 93db912

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

kernel/locking/locktorture.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,6 @@ static int torture_rtmutex_lock(void) __acquires(torture_rtmutex)
436436

437437
static void torture_rtmutex_boost(struct torture_random_state *trsp)
438438
{
439-
int policy;
440-
struct sched_param param;
441439
const unsigned int factor = 50000; /* yes, quite arbitrary */
442440

443441
if (!rt_task(current)) {
@@ -448,8 +446,7 @@ static void torture_rtmutex_boost(struct torture_random_state *trsp)
448446
*/
449447
if (trsp && !(torture_random(trsp) %
450448
(cxt.nrealwriters_stress * factor))) {
451-
policy = SCHED_FIFO;
452-
param.sched_priority = MAX_RT_PRIO - 1;
449+
sched_set_fifo(current);
453450
} else /* common case, do nothing */
454451
return;
455452
} else {
@@ -462,13 +459,10 @@ static void torture_rtmutex_boost(struct torture_random_state *trsp)
462459
*/
463460
if (!trsp || !(torture_random(trsp) %
464461
(cxt.nrealwriters_stress * factor * 2))) {
465-
policy = SCHED_NORMAL;
466-
param.sched_priority = 0;
462+
sched_set_normal(current, 0);
467463
} else /* common case, do nothing */
468464
return;
469465
}
470-
471-
sched_setscheduler_nocheck(current, policy, &param);
472466
}
473467

474468
static void torture_rtmutex_delay(struct torture_random_state *trsp)

0 commit comments

Comments
 (0)