Skip to content

tsacct: keep task begin times stable across suspend

Hungyu Lin lkml stable 2 versions – Applied

Status from this message: The following commit has been merged into the timers/urgent branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied
  2. v11 patch 0 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2timekeeping: Read getboottime64() offsets under the sequence counterkernel/time/timekeeping.c+7 -11 reply
2/2tsacct: keep task begin times stable across suspendkernel/tsacct.c+6 -40 replies

Reviews trailers per patch

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

PatchJohn Stultz
1/2A-b
2/2

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

Read the v2 thread

Cover letter [PATCH v2 0/2] tsacct: keep task begin times stable across suspend

Keep taskstats begin times stable across suspend without changing the MONOTONIC elapsed-time fields.

Patch 1 makes getboottime64() sample its offsets under tk_core.seq. Patch 2 uses that helper and the task's BOOTTIME start timestamp, and clamps negative begin times to zero. Keep the helper prerequisite when backporting the taskstats change.

Changes in v2, addressing Andrew Morton's review:
- Add the getboottime64() sampling prerequisite as patch 1/2.
- Lower-clamp ac_btime64 without imposing a 32-bit upper limit.
- Add Cc: stable to both patches.
- Rebase onto mainline d89e1d186ec9.

Validation used GCC 13.3.0 with W=1. ARM64 and native 32-bit SMP x86 QEMU guests pass all 36 checks, including the original 24. The 32-bit helper stress reproduced inconsistent timestamps before the fix and none after. Suspend time was injected through the real timekeeping hook.

v1: https://lore.kernel.org/r/[email protected]

Hungyu Lin (2):
timekeeping: Read getboottime64() offsets under the sequence counter
tsacct: keep task begin times stable across suspend

 kernel/time/timekeeping.c |  8 +++++++-
 kernel/tsacct.c           | 10 ++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

base-commit: d89e1d186ec9271bf78e62771779e9fc03bf0fc3

Signature · 1 line
2.43.0