Commit 7ea98df
sched/deadline: Add more reschedule cases to prio_changed_dl()
I've been tracking down an issue on a ~5.17ish kernel where:
CPUx CPUy
<DL task p0 owns an rtmutex M>
<p0 depletes its runtime, gets throttled>
<rq switches to the idle task>
<DL task p1 blocks on M, boost/replenish p0>
<No call to resched_curr() happens here>
[idle task keeps running here until *something*
accidentally sets TIF_NEED_RESCHED]
On that kernel, it is quite easy to trigger using rt-tests's deadline_test
[1] with the test running on isolated CPUs (this reduces the chance of
something unrelated setting TIF_NEED_RESCHED on the idle tasks, making the
issue even more obvious as the hung task detector chimes in).
I haven't been able to reproduce this using a mainline kernel, even if I
revert
2972e30 ("tracing: Make trace_marker{,_raw} stream-like")
which gets rid of the lock involved in the above test, *but* I cannot
convince myself the issue isn't there from looking at the code.
Make prio_changed_dl() issue a reschedule if the current task isn't a
deadline one. While at it, ensure a reschedule is emitted when a
queued-but-not-current task gets boosted with an earlier deadline that
current's.
[1]: https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://lore.kernel.org/r/20230206140612.701871-1-vschneid@redhat.com1 parent 829c165 commit 7ea98df
1 file changed
Lines changed: 27 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2663 | 2663 | | |
2664 | 2664 | | |
2665 | 2665 | | |
2666 | | - | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
2667 | 2669 | | |
2668 | | - | |
2669 | | - | |
2670 | | - | |
2671 | | - | |
2672 | | - | |
2673 | | - | |
2674 | | - | |
2675 | | - | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
2676 | 2678 | | |
| 2679 | + | |
2677 | 2680 | | |
2678 | 2681 | | |
2679 | 2682 | | |
2680 | 2683 | | |
2681 | 2684 | | |
2682 | 2685 | | |
2683 | 2686 | | |
2684 | | - | |
| 2687 | + | |
2685 | 2688 | | |
2686 | | - | |
2687 | | - | |
2688 | | - | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
2689 | 2693 | | |
2690 | | - | |
2691 | | - | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
2692 | 2697 | | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
2693 | 2705 | | |
2694 | 2706 | | |
2695 | 2707 | | |
| |||
0 commit comments