Fixes for two recently found timekeeping bugs
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 1 replyIn review
- v23 patches 2 repliesSuperseded
- v1 RFC4 patches 11 repliesSuperseded
Changes in v3 from the cover letter
* Incorperated Thomas' suggested commit message
* Addressed clock->read(clock) race that also affects the fast-timekeeper
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | time: Fix clock->read(clock) race around clocksource changesinclude/ kernel/ | +36 | 0 replies | |
| 2/3 | time: Fix CLOCK_MONOTONIC_RAW sub-nanosecond accountinginclude/ kernel/ | +12 | 1 reply | |
| 3/3 | arm64: vdso: Fix nsec handling for CLOCK_MONOTONIC_RAWarch/ arch/ | +3 | 0 replies |
Reviews trailers per patch
2 of 3 patches have a Reviewed-by or Acked-by.
| Patch | Daniel Mentz | Ingo Molnar | Kevin Brodsky |
|---|---|---|---|
| 1/3 | A-b | ||
| 2/3 | T-b | ||
| 3/3 | T-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH 0/3 v3] Fixes for two recently found timekeeping bugs
As part of the Linaro Linux Kernel Functional Test (LKFT) effort, test failures from kselftest/timer's inconsistency-check were reported connected to CLOCK_MONOTONIC_RAW, on the HiKey platform.
Digging in I found that an old issue with how sub-ns accounting is handled with the RAW time which was fixed long ago with the CLOCK_MONOTONIC/REALTIME ids, but missed with RAW time, was present.
Additionally, running further tests, I uncovered an issue with how the clocksource read function is handled when clocksources are changed, which can cause crashes.
Both of these issues have not been uncovered in x86 based testing due to x86 not using vDSO to accelerate CLOCK_MONOTONIC_RAW, combined with the HiKey's arch_timer clocksource being fast to access but incrementing slowly enough to get multiple reads using the same counter value (which helps uncover time handing issues), along with the fact that none of the x86 clocksources making use of the clocksource argument passed to the read function.
This patchset addresses these two issues.
Thanks so much to help from Will Deacon in getting the needed adjustments to the arm64 vDSO in place. Also thanks to Daniel Mentz who also properly diagnosed the MONOTONIC_RAW issue in parallel while I was woking on this patchset.
As always feedback would be appreciated!
thanks
-john
v2:
* Addressed style/phrasing feedback from Ingo
* Dropped the final cleanup patch, since it can wait for 4.13-rc
v3:
* Incorperated Thomas' suggested commit message
* Addressed clock->read(clock) race that also affects the fast-timekeeper
John Stultz (2):
time: Fix clock->read(clock) race around clocksource changes
time: Fix CLOCK_MONOTONIC_RAW sub-nanosecond accounting
Will Deacon (1):
arm64: vdso: Fix nsec handling for CLOCK_MONOTONIC_RAW
arch/arm64/kernel/vdso.c | 5 ++- arch/arm64/kernel/vdso/gettimeofday.S | 1 - include/linux/timekeeper_internal.h | 5 +-- kernel/time/timekeeping.c | 71 +++++++++++++++++++++++------------ 4 files changed, 51 insertions(+), 31 deletions(-)
Signature · 1 line
2.7.4