Commit 9d9e522
committed
posix-timers: Prevent RT livelock in itimer_delete()
itimer_delete() has a retry loop when the timer is concurrently expired. On
non-RT kernels this just spin-waits until the timer callback has completed,
except for posix CPU timers which have HAVE_POSIX_CPU_TIMERS_TASK_WORK
enabled.
In that case and on RT kernels the existing task could live lock when
preempting the task which does the timer delivery.
Replace spin_unlock() with an invocation of timer_wait_running() to handle
it the same way as the other retry loops in the posix timer code.
Fixes: ec8f954 ("posix-timers: Use a callback for cancel synchronization on PREEMPT_RT")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/87v8g7c50d.ffs@tglx1 parent b7a7ce1 commit 9d9e522
1 file changed
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
| 1040 | + | |
| 1041 | + | |
1041 | 1042 | | |
1042 | 1043 | | |
1043 | 1044 | | |
1044 | | - | |
1045 | | - | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
1046 | 1051 | | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1047 | 1059 | | |
1048 | | - | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
1049 | 1074 | | |
1050 | 1075 | | |
1051 | 1076 | | |
1052 | 1077 | | |
1053 | | - | |
| 1078 | + | |
1054 | 1079 | | |
1055 | 1080 | | |
1056 | 1081 | | |
1057 | 1082 | | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
1061 | 1086 | | |
1062 | 1087 | | |
1063 | 1088 | | |
| |||
1067 | 1092 | | |
1068 | 1093 | | |
1069 | 1094 | | |
| 1095 | + | |
1070 | 1096 | | |
1071 | 1097 | | |
1072 | 1098 | | |
1073 | 1099 | | |
| 1100 | + | |
1074 | 1101 | | |
1075 | 1102 | | |
1076 | 1103 | | |
| |||
0 commit comments