From: Hungyu Lin <dennylin0707@gmail.com>
To: tglx@kernel.org, jstultz@google.com
Cc: sboyd@kernel.org, mlichvar@redhat.com, akpm@linux-foundation.org,
oleg@redhat.com, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, dennylin0707@gmail.com
Subject: [PATCH v2 0/2] tsacct: keep task begin times stable across suspend
Date: Fri, 30 Oct 2026 05:42:25 +0000 [thread overview]
Message-ID: <20261030054227.35453-1-dennylin0707@gmail.com> (raw)
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
next reply other threads:[~2026-10-30 5:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 5:42 Hungyu Lin [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261030054227.35453-1-dennylin0707@gmail.com \
--to=dennylin0707@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mlichvar@redhat.com \
--cc=oleg@redhat.com \
--cc=sboyd@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®