History

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.

Peter Zijlstra committed 6 years ago

Commit 93db9121 parent 7a407981 file · +2 −8Browse files

Unified · Split

kernel/locking/locktorture.c+2−8
@@ -436,8 +436,6 @@ static int torture_rtmutex_lock(void) __acquires(torture_rtmutex) · 435 unmodified lines
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) · 4 unmodified lines
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) · 6 unmodified lines
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)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t