Skip to content

Upper bound kernel timers

Artem Savkov lkml netdev oe-lkp 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 4 repliesIn review
  2. v42 patches 3 repliesSuperseded
  3. v32 patches 6 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches0 repliesSuperseded
v12 patches5 repliesSuperseded

Changes in v5 from the cover letter

- The least intrusive and most straightforward approach. This avoids touching any of existing code. The timeout supplied is always reduced by a known timer wheel error margin of 12.5%.
- Commit message adjustments.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2timer: add a function to adjust timeouts to be upper boundinclude/linux/timer.h kernel/time/timer.c+15 -00 replies
2/2net: make tcp keepalive timer upper boundnet/ipv4/inet_connection_sock.c+1 -13 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJosh Poimboeuf
1/2
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/2] Upper bound kernel timers

As previously discussed [1] we had a report of a regression in TCP keepalive timer where timers were up to 4 minutes late resulting in disconnects.

This patchset tries to fix the problem by introducing upper bound kernel timers and making tcp keepalive timer use those.

[1] https://lore.kernel.org/all/20210302001054.4qgrvnkltvkgikzr@treble/T/#u

---
Changes in v5:
- The least intrusive and most straightforward approach. This avoids touching any of existing code. The timeout supplied is always reduced by a known timer wheel error margin of 12.5%.
- Commit message adjustments.

Changes in v4:
- Drop any attempts to be smart when calculating timer adjustment and always substract LVL_GRAN so that base clock lag won't be such a problem. This means that in some cases we will always be early, but all we want is not to be late.

Changes in v3:
- A different approach: instead of introducing upper bound timers try to account for timer wheen granularity on timer (re)arming step.
- Not sure whether moving lvl calculation into a separate function is worth

    it.

- Had a hard time naming the upper_bount_timeout() function - any suggestions welcome.

Changes in v2:
- TIMER_UPPER_BOUND flag description added as a comment in timer.h
- Code style fixes
- More elaborate commit message in timer commit

Artem Savkov (2):
timer: add a function to adjust timeouts to be upper bound
net: make tcp keepalive timer upper bound

 include/linux/timer.h           |  1 +
 kernel/time/timer.c             | 14 ++++++++++++++
 net/ipv4/inet_connection_sock.c |  2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1