mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] tsacct: keep task begin times stable across suspend
@ 2026-10-30  5:42 Hungyu Lin
  2026-10-30  5:42 ` [PATCH v2 1/2] timekeeping: Read getboottime64() offsets under the sequence counter Hungyu Lin
  2026-10-30  5:42 ` [PATCH v2 2/2] tsacct: keep task begin times stable across suspend Hungyu Lin
  0 siblings, 2 replies; 3+ messages in thread
From: Hungyu Lin @ 2026-10-30  5:42 UTC (permalink / raw)
  To: tglx, jstultz
  Cc: sboyd, mlichvar, akpm, oleg, linux-kernel, stable, dennylin0707

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/20261026005506.2253-1-dennylin0707@gmail.com

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
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-30  5:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30  5:42 [PATCH v2 0/2] tsacct: keep task begin times stable across suspend Hungyu Lin
2026-10-30  5:42 ` [PATCH v2 1/2] timekeeping: Read getboottime64() offsets under the sequence counter Hungyu Lin
2026-10-30  5:42 ` [PATCH v2 2/2] tsacct: keep task begin times stable across suspend Hungyu Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®