alarmtimers/posixtimers: Bug fixes and spec conformity changes
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest26 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/26 | alarmtimer: Prevent overflow of relative timerskernel/ | +3 | 0 replies | |
| 2/26 | alarmtimer: Rate limit periodic intervalskernel/ | +8 | 0 replies | |
| 3/26 | alarmtimer: Remove pointless config conditionalkernel/ | +1 | 0 replies | |
| 4/26 | posix-timers: Remove unused export of posix_timer_event()kernel/ | +0 | 0 replies | |
| 5/26 | posix-clocks: Remove interval timer facility and mmap/fasync callbacksinclude/ kernel/ | +0 | 1 reply | |
| 6/26 | posix-timers: Avoid gazillions of forward declarationskernel/ | +89 | 0 replies | |
| 7/26 | posix-timers: Cleanup struct k_itimerinclude/ | +40 | 0 replies | |
| 8/26 | posix-timers: Move posix-timer internals to coreinclude/ kernel/ kernel/ +3 more | +16 | 1 reply | |
| 9/26 | posix-timers: Unify overrun/requeue_pending handlingkernel/ kernel/ | +15 | 0 replies | |
| 10/26 | posix-timers: Move interval out of the unioninclude/ kernel/ kernel/ | +18 | 0 replies | |
| 11/26 | posix-timers: Store k_clock pointer in k_itimerinclude/ kernel/ kernel/ | +8 | 0 replies | |
| 12/26 | posix-timers: Add timer_rearm() callbackinclude/ | +20 | 0 replies | |
| 13/26 | posix-timers: Rename do_schedule_next_timerinclude/ kernel/ kernel/ +1 more | +8 | 3 replies | |
| 14/26 | posix-timers: Use timer_rearm() callback in posixtimer_rearm()kernel/ kernel/ kernel/ | +11 | 0 replies | |
| 15/26 | posix-timers: Add active flag to k_itimerinclude/ kernel/ | +9 | 0 replies | |
| 16/26 | posix-timers: Add forward/remaining callbacksinclude/ | +2 | 0 replies | |
| 17/26 | posix-timers: Make use of forward/remaining callbackskernel/ | +49 | 0 replies | |
| 18/26 | posix-timers: Zero settings value in common codekernel/ kernel/ | +2 | 4 replies | |
| 19/26 | posix-timers: Add cancel/arm callbacksinclude/ | +3 | 0 replies | |
| 20/26 | posix-timers: Make use of cancel/arm callbackskernel/ | +100 | 0 replies | |
| 21/26 | alarmtimer: Implement timer_rearm() callbackkernel/ | +14 | 0 replies | |
| 22/26 | alarmtimer: Implement forward callbackkernel/ | +13 | 0 replies | |
| 23/26 | alarmtimer: Implement remaining callbackkernel/ | +22 | 0 replies | |
| 24/26 | alarmtimer: Implement try_to_cancel callbackkernel/ | +10 | 0 replies | |
| 25/26 | alarmtimer: Implement arm callbackkernel/ | +22 | 0 replies | |
| 26/26 | alarmtimer: Switch over to generic set/get/rearm routinekernel/ kernel/ kernel/ | +29 | 0 replies |
Reviews trailers per patch
1 of 26 patches has a Reviewed-by or Acked-by.
| Patch | Richard Cochran |
|---|---|
| 1/26 | |
| 2/26 | |
| 3/26 | |
| 4/26 | |
| 5/26 | A-b |
| 6/26 | |
| 7/26 | |
| 8/26 | |
| 9/26 | |
| 10/26 | |
| 11/26 | |
| 12/26 | |
| 13/26 | |
| 14/26 | |
| 15/26 | |
| 16/26 | |
| 17/26 | |
| 18/26 | |
| 19/26 | |
| 20/26 | |
| 21/26 | |
| 22/26 | |
| 23/26 | |
| 24/26 | |
| 25/26 | |
| 26/26 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [patch 00/26] alarmtimers/posixtimers: Bug fixes and spec conformity changes
The syzkaller folks reported an RCU stall while fuzzing the posix timer interface with CLOCK_ALARMTIMER_*.
While fixing this issue, I noticed that the posix timer implementation of alarm timers lacks quite some of the features of the regular hrtimer based posix timers.
That makes alarm timer bases posix timer not conform to the spec and also the unconditional self rearming of those timer is suboptimal.
Instead of copying the posix timer hrtimer based mechanism over to alarm timers with the risk of getting out of sync sooner than later, I decided to add a few callbacks to the kclock struct which describes the different posix timer clocks, so the existing and proven to be correct implementation can be reused and we have only one implementation to maintain, aside of the special magic which handles the CPU/PROCESS/THREAD clock ids.
Patch 1/2 are the bugfixes addressing the reported problem (#1) and a similar one (#2) which I detected in review.
Patch 3-8 are cleanups which I put in front of the actual rework, including the removal of unused and prone to be implemnted wrong posix timer callbacks for the dynamic posix clocks.
Patch 9-20 prepare the code in posix-timer.c for sharing and reuse and the remaining patches 21-26 switch the alarm timers over.
Passes LTP and GLIBC tests and a few other test cases I have around.
Thanks,
tglx
--- b/kernel/time/posix-timers.h | 13 + include/asm-generic/siginfo.h | 2 include/linux/posix-clock.h | 22 -- include/linux/posix-timers.h | 117 ++++++----- kernel/signal.c | 2 kernel/time/alarmtimer.c | 200 +++++++++----------- kernel/time/posix-clock.c | 115 ----------- kernel/time/posix-cpu-timers.c | 36 +-- kernel/time/posix-timers.c | 410 ++++++++++++++++++++++------------------- 9 files changed, 429 insertions(+), 488 deletions(-)