diff options
-rw-r--r-- | kernel/sched.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 1803667dbb6e..32d7eb474fa7 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -6714,7 +6714,25 @@ recheck: | |||
6714 | if (running) | 6714 | if (running) |
6715 | p->sched_class->set_curr_task(rq); | 6715 | p->sched_class->set_curr_task(rq); |
6716 | if (on_rq) { | 6716 | if (on_rq) { |
6717 | activate_task(rq, p, 0, false); | 6717 | /* |
6718 | * Workaround to make prio ceiling work as expected: | ||
6719 | * | ||
6720 | * Queue task to head when task is running and task is | ||
6721 | * lowering its priority. This works around the non- | ||
6722 | * availability of a sched_setprio syscall which was | ||
6723 | * tinkered into the posix spec to make prio ceiling | ||
6724 | * work correctly. | ||
6725 | * | ||
6726 | * This workaround violates the posix scheduling | ||
6727 | * semantics of tail queueing in the case that the | ||
6728 | * priority was changed by anything else than | ||
6729 | * sched_setprio, but there is no other breakage | ||
6730 | * lurking than some specification fetishists going | ||
6731 | * berserk on me. | ||
6732 | * | ||
6733 | * Fixing this in mainline needs more thoughts. | ||
6734 | */ | ||
6735 | activate_task(rq, p, 0, running && oldprio < p->prio); | ||
6718 | 6736 | ||
6719 | check_class_changed(rq, p, prev_class, oldprio, running); | 6737 | check_class_changed(rq, p, prev_class, oldprio, running); |
6720 | } | 6738 | } |