mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhan Xusheng <zhanxusheng1024@gmail.com>
To: tglx@kernel.org, thomas.weissschuh@linutronix.de
Cc: luto@kernel.org, vincenzo.frascino@arm.com,
	david.laight.linux@gmail.com, linux-kernel@vger.kernel.org,
	zhanxusheng@xiaomi.com
Subject: [PATCH v5 0/4] vdso: Keep the CLOCK_AUX base at full precision
Date: Wed, 16 Sep 2026 10:32:48 +0800	[thread overview]
Message-ID: <20260916023252.418473-1-zhanxusheng@xiaomi.com> (raw)

Patch 3/4 is the fix.  vdso_time_update_aux() rounds the CLOCK_AUX base
down to whole nanoseconds, so the vDSO reports 0 or 1 ns below
ktime_get_aux() for the same clock.  1/4 and 2/4 prepare the division
helper it uses.  4/4 is independent of the fix and can be dropped without
affecting the rest.

Changes since v4:

 - Every patch carries a single From: now.  format.from was set to a
   different address than user.email, so format-patch emitted a header
   From plus an in-body From, and send-email then added a second in-body
   one.  That setting is gone; git am records zhanxusheng@xiaomi.com for
   all four patches.

 - 1/4: rewrite the changelog, which referred to a loop it had not
   introduced.  Also put __iter_div_u64_rem()'s signature on one line, so
   that the two helpers in the file do not end up in different styles.

 - 2/4: put the __iter_div64_u64_rem() signature on one line, 90
   characters.  Rewrite the changelog and correct a size claim that did
   not survive re-measurement: the 16 bytes come from folding the two
   open-coded loops into one inlined helper, and the u32 return type makes
   no difference to vsyscall.o on x86-64.

 - 4/4: rewrite the subject and changelog using the wording the code uses
   for this.  "clock id dispatch" and "dispatch mask" were mine, not the
   kernel's.

 - 3/4 is unchanged.

 - The tag block follows the maintainer-tip.rst order now, which puts the
   author's Signed-off-by ahead of Reviewed-by.

Testing on x86-64: checkpatch --strict, gcc W=1 and make LLVM=1 are all
clean.  Built and booted with kernel/configs/x86_debug.config plus
panic_on_warn=1; no warning fired and the log holds no lockdep or
debug-object complaint.  A guest with an aux clock enabled saw no vDSO
reading ahead of a later ktime_get_aux() in 100000 samples at each of
offset 0, +5.123456789 and a negative offs_aux.

The generated code in vsyscall.o, vdso64 and vdso32 is byte-identical to
v4, so the reflowed lines changed nothing.

v4: https://lore.kernel.org/all/20260902033801.2912699-1-zhanxusheng@xiaomi.com

Zhan Xusheng (4):
  vdso/math64: Use OPTIMIZER_HIDE_VAR() in __iter_div_u64_rem()
  vdso/math64: Add and use __iter_div64_u64_rem()
  vdso/vsyscall: Keep the CLOCK_AUX base scaled
  vdso/gettimeofday: Assert that the clockid fits into the u32 bitmask

 include/vdso/math64.h   | 31 ++++++++++++++++++++++++++-----
 kernel/time/vsyscall.c  | 26 ++++++++++----------------
 lib/vdso/gettimeofday.c |  2 ++
 3 files changed, 38 insertions(+), 21 deletions(-)


base-commit: 9b87fdc9af2fbfcdb5c24a64139685ef80f6573f
-- 
2.43.0


             reply	other threads:[~2026-09-16  2:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  2:32 Zhan Xusheng [this message]
2026-09-16  2:32 ` [PATCH v5 1/4] vdso/math64: Use OPTIMIZER_HIDE_VAR() in __iter_div_u64_rem() Zhan Xusheng
2026-09-25  7:44   ` Thomas Weißschuh
2026-09-29 19:27   ` [tip: timers/vdso] " tip-bot2 for Zhan Xusheng
2026-09-16  2:32 ` [PATCH v5 2/4] vdso/math64: Add and use __iter_div64_u64_rem() Zhan Xusheng
2026-09-29 19:27   ` [tip: timers/vdso] " tip-bot2 for Zhan Xusheng
2026-09-16  2:32 ` [PATCH v5 3/4] vdso/vsyscall: Keep the CLOCK_AUX base scaled Zhan Xusheng
2026-09-29 19:27   ` [tip: timers/vdso] " tip-bot2 for Zhan Xusheng
2026-09-16  2:32 ` [PATCH v5 4/4] vdso/gettimeofday: Assert that the clockid fits into the u32 bitmask Zhan Xusheng
2026-09-29 19:27   ` [tip: timers/vdso] " tip-bot2 for Zhan Xusheng
2026-09-30 12:41 ` [PATCH v5 0/4] vdso: Keep the CLOCK_AUX base at full precision Thomas Gleixner

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=20260916023252.418473-1-zhanxusheng@xiaomi.com \
    --to=zhanxusheng1024@gmail.com \
    --cc=david.laight.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=zhanxusheng@xiaomi.com \
    /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®